应该可以试着单看端口是否打开。What port does Remote Desktop use? Does everything go over port 3389?Port 3389 is the only port you need to open. Windows will attempt to stream sound through User Datagram Protocol (UDP) first. If no port is available for UDP, sound will stream through a virtual channel in Remote Desktop Protocol, which uses port 3389.
我已经研究出来了 用SOCKET的类tcpclient来判断
bool tcpListen = false;
//bool udpListen = false;//设定端口状态标识位
System.Net.IPAddress myIpAddress = IPAddress.Parse(a);
System.Net.IPEndPoint myIpEndPoint = new IPEndPoint(myIpAddress, 9009);
try
{
System.Net.Sockets.TcpClient tcpClient = new TcpClient();
tcpClient.Connect(myIpEndPoint);//对远程计算机的指定端口提出TCP连接请求
if (tcpClient.Connected == true)
{
tcpListen = true;
}
}
catch
{
}