Reputation: 63
Process: I'm currently developing a Game Launcher through Visual Studio. After being successful with everything so far I have come across "A coding idea" that I just can't figure out how to code.
Attempts:
Base Line (Opens Teamspeak):
private void btnFoxedTs_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe");
}
Joining Server (Through IP):
private void btnFoxedTs_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"C:\Program Files\TeamSpeak 3 Client\ts3client_win64.exe://voice.teamspeak.com:9987");
}
Thrown Error:
Any Ideas???
My Plans: I'm wanting to make the button "Auto-Connect" to the Teamspeak server upon, the "Teamspeak Client" opening. Without the user needing to input a Bookmark, Server IP, Anything like that.
If Possible: If this works, would I be able to include a Teamspeak server password, so when they click the button is "Auto-Connects" with a pre-imputed password (Without the user needing to type a password).
Upvotes: 2
Views: 3284
Reputation: 17797
Just use the ts3server://
url to run the TS3 client, you can provide all nessecary parameters there.
Basic example:
System.Diagnostics.Process.Start("ts3server://voice.teamspeak.com?password=serverPassword");
The TeamSpeak client registeres itself for the protocol and will be started by Windows it is invoked. You don't even need to bother with the path to the client.
More parameters are described in the official FAQ.
Upvotes: 4
Reputation: 63
After going through those posts that @GeraldSchneider gave me, I found found this "ts3server://ts3.hoster.com:9987" Parameter URL used in linking your Teamspeak to a Webpage. After playing around a bit, trying out different methods,
I came up with this code:
private void btnFoxedTs_Click(object sender, EventArgs e)
{
var p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\Program Files\\TeamSpeak 3 Client\\ts3client_win64.exe";
p.StartInfo.Arguments = "ts3server://voice.teamspeak.com";
p.Start();
}
One thing that I must say, after reading the Teamspeak Forums saying that "Command-Line Parameters are not possible", it feels good to get this working.
What it does:
The Code opens up your 'Teamspeak Client' and 'Auto-Connects' to the server that is implemented. The Server opens up in a "new-tab" (If you are connect to other servers) and joined with your pre-set 'Nickname'.
Disclaimer Note: I used the "Default Teamspeak Server Ip" in this post so my personal Teamspeak isn't displayed.
Upvotes: 3