If you have Teamviewer installed on the your local pc you can use this method.
In this example tbID
is a textbox in which the user types the Teamviewer ID and tbPassword
is a textbox in which the user types the Teamviewer Password.
private const string path = @"C:\Program Files(x86)\TeamViewer\TeamViewer.exe";
private const string arguments = " -i {0} --Password {1}";
public TeamViewerDialog()
{
InitializeComponent();
}
private void btnGo_Click(object sender, EventArgs e)
{
if (!tbID.Text.Equals(string.Empty) && !tbPassword.Text.Equals(string.Empty))
{
System.Diagnostics.Process.Start(path, string.Format(arguments, tbID.Text, tbPassword.Text));
Close();
}
}
This example starts TeamViewer with arguments containing a TeamviewerID and password. If the password and ID are correct Teamviewer will immediately start a new session. I tested the example with teamviewer10. If there was already a teamviewer instance running this wil not create a seccond instance but use the existing one.
Documentation about the start parameters can be found here:
https://www.teamviewer.com/en/help/91-Are-there-parameters-to-start-TeamViewer
In the case of asp.net you might want to check the last 2 pages of the TeamViewer Api documentation which contain URL's to connect teamviewer.
This documentation can be found here:
https://www.teamviewer.com/en/for-developers/teamviewer-api/