I have a list of computers from a SQL table Computers
(with columns computerid guid, computername varchar(80), TeamviewerID varchar(30)
) and I want to create a web app that links teamviewer id and can start a teamviewer session.
I have read and search lots of documents but did not find any way.
Can anyone please suggest me or provide me any example that can help me in this.
In ASP.NET you could generate something like a grid, with a list of computers, TeamViewer IDs and a "Connect" button.
This button should just open a browser tab to the following URL: teamviewer8://remotecontrol?connectcc=12345
- Replace 12345 for the "BuddyID" that is related to the TeamViewerID of the computer that you want to connect to.
- TeamViewer 8.1 or higher should be installed in your machine.
- You have to be locally logged in your TeamViewer account to the remotecontrol command to work.
How to create a TeamViewer account: https://login.teamviewer.com
More info about using the API here. https://integrate.teamviewer.com/en/index.aspx
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/
来源:https://stackoverflow.com/questions/22092319/how-to-start-teamviewer-session-on-the-basis-of-teamviewerid-in-asp-net