大家好我安装了Teamviewer,希望能够ping Teamviewer ID并获得该PC状态的响应。
try
{
string accessToken = "xxxxxxxxxxxxxxxxxxxx";
string Version = "v1";
string tvApiUrl = "https://webapi.teamviewer.com";
string address = tvApiUrl + "/api/" + Version + "/various commands from API";
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.Headers.Set("Authorization", "Bearer " + accessToken);
request.Method = "GET";
WebResponse response = request.GetResponse();
return response;
}
catch (Exception ex)
{
MessageBox.Show("Failed to get request with error: " + ex.Message);
return null;
}
这不会起作用,因为我没有找到与Teamviewer中的远程计算机列表相关的任何内容。我想要一种方法来检查我的Teamviewer列表中的PC是否具有网络编程功能。提前致谢
答案 0 :(得分:1)
这可以使用TeamViewer API。
来实现查看“3.10设备”下的documentation:
GET / api / v1 / devices (列出计算机和联系人列表中的所有设备)
参数
返回值
验证
请求
GET /api/v1/devices
响应
HTTP/1.1 200 OK
Content-Type: application/json
{ "devices": [
{
"remotecontrol_id": "r123456789",
"device_id": "d123456789",
"alias": "PC",
"groupid": "g12345678",
"online_state": "Online"
},
{
"remotecontrol_id": "r123456780",
"device_id": "d345667567",
"alias": "Laptop",
"groupid": "g12345678",
"online_state": "Offline"
},
{
"remotecontrol_id": "r345678890",
"device_id": "d444443226",
"alias": "Office",
"groupid": "g12345678",
"online_state": "Offline"
}
]
}