3

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sikha
  • 63
  • 3
  • 10

2 Answers2

2

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

Adrian Salazar
  • 5,279
  • 34
  • 51
  • thanks ..can you please explain 1st and last point again with more explanation.?? – sikha Feb 28 '14 at 10:53
  • @sikha If you open TeamViewer in your machine, you will see a menu called computer and contacts. There it will ask you to login using your teamviewer account. Each teamviewer ID is unique to the machine.But what the remotecontrol command requires is the buddyid, that means, the internal ID if that computer in your own personal list. That you can get it retrieving your contacts list using the API. – Adrian Salazar Feb 28 '14 at 11:21
  • you'r explanations are really impressive.Now i have one basic question.I checked by clicking on "computer and contacts" on teamviewer on my system.I see that i can create group and can add "contacts" there.But see i have sql table that have all columns like computer name etc.so should i need to add these contacts manually or we have anything in api that will fetch and add contacts in teamviwer.That is what confusing me now.. – sikha Feb 28 '14 at 13:09
  • @sikha Yes, of course there is an API. http://integrate.teamviewer.com/en/develop/ – Adrian Salazar Feb 28 '14 at 13:19
  • thanks i can see there are 2 options one to create script and other to create app.So i need to create app. – sikha Feb 28 '14 at 13:47
  • I am getting one error.i just pass teamviewerid like this teamviewer9://remotecontrol?connectcc=" + tvId.its redirecting to url and says unknown error .can you please tell me where i am wrong.Thanks – sikha Mar 04 '14 at 17:48
  • how i can get BuddyID.right now i am passing teamviewerid.Please let me know.Thanks – sikha Mar 04 '14 at 17:52
  • adrian - i was going to post a new question as this info is so scarce on the interwebs, however, hopefully you can answer ahead of that. I am using the technique above (teamviewer8://remotecontrol?connectcc=114208503) to open a teamviewer session and all works well with my different buddyid's. however, i hit a very annoying issue when invoking the same id for a second time. A second window is opened for the id, even tho the particular session is still open for it. – jim tollan Mar 06 '14 at 13:30
  • second comment as not enough room!; .. This is quite annoying as I'd like it to work in the same way as the teamviewer control pannel (i.e. check to see if there is already a session running). do you know if there's an additional parameter that's required to make the id window either open if new or come into focus if already running?? the app that i have has the potential to literally open hundreds of duplicate windows as i'm looking at many processes across a small range of id's over a concentrated period of time. fingers xx'd – jim tollan Mar 06 '14 at 13:34
  • btw -i added a new question to SO with more details: http://stackoverflow.com/questions/22226739/connecting-teamviewer-via-browser – jim tollan Mar 06 '14 at 14:08
  • @jimtollan I can't hep you with your question, as the options to the protocol are obscure to me. However, I'm glad that you've found a workaround for this. Hopefully the rest API will offer all of the functionality you need in the near future. Today only session codes are fully supported for that matter with REST. – Adrian Salazar Mar 07 '14 at 10:28
  • adrian, the workaround, altho not perfect, was the most pragmatic way to approach this problem in the timescale. the api will no doubt yield further opportunity later on. – jim tollan Mar 10 '14 at 10:13
0

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/

live2
  • 3,771
  • 2
  • 37
  • 46
Maiko Kingma
  • 929
  • 3
  • 14
  • 29