且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用rdp登录远程计算机时如何启动bat文件

更新时间:2023-01-30 10:10:57

没有实际意义。两件事:1)ping是ping,它可以在任何计算机上完成,无论是RDP客户端还是服务器主机;所以没有必要远程ping; 2)没有必要运行任何批处理文件来ping。



让我们看看。您可以ping任何运行支持 ICMP 协议的服务的计算机系统。这意味着几乎所有参与网络的非废话系统。请参阅:

http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol [ ^ ],

http://en.wikipedia.org/wiki/Ping_%28networking_utility%29 [ ^ ]。



你没有解释你试图ping什么系统,你的RDP服务主机,客户端或其他一个,所以你的逻辑很难理解。我可以说一件事:不管它是什么,这个逻辑对我来说都很奇怪。也许你可以解释一下。不管;这就是你可以从任何地方ping任何系统的方法: https://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping%28v=vs.110%29.aspx [ ^ ]。



这样,你不需要破解不自然的谜语。 :-)



由于活动部分一如既往地是客户端部分,因此很可能需要在客户端添加ping功能,即方式,更容易做,因为你总是可以实现自定义RDP客户端,这很简单。您可以查看一些现有的实现,例如CodeProject中的那两个:

Palantir - 远程桌面经理 [ ^ ](我的最爱),

使用C#.NET的远程桌面 [ ^ ]。



-SA
It makes no practical sense. Two things: 1) ping is ping, it can be done on any computer, either the host of RDP client or server; so there is no need to "ping remotely"; 2) there is no need to run any batch file to ping.

Let's see. You can ping any computer system running the service supporting the ICMP protocol. That means nearly all non-nonsense systems participating in networking. Please see:
http://en.wikipedia.org/wiki/Internet_Control_Message_Protocol[^],
http://en.wikipedia.org/wiki/Ping_%28networking_utility%29[^].

You did not explain what system did you try to ping, the host of your RDP service, client, or some other one, so your logic is hard to understand. I can say one thing: whatever it is, this logic would like quite weird to me. Perhaps you can explain. No matter; this is how you can ping any system from anywhere: https://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping%28v=vs.110%29.aspx[^].

This way, you don't need to crack unnatural riddles. :-)

As the active part is, as always, the client part, most likely you need to add the ping functionality on the client, which is, by the way, easier to do, because you can always implement custom RDP client, which is simple enough. You can review some existing implementations, such as those two from CodeProject:
Palantir - Remote Desktop Manager[^] (my favorite),
Remote Desktop using C#.NET[^].

—SA