使用批处理文件可以执行以下操作:
ping google.com
如果返回成功做ECHO您已连接到互联网
否则返回ECHO您没有连接到互联网
我开发了一个C#程序,虽然当我尝试从中创建一个服务时,例如
sc create "servicetest" binPath=
"C:\Users\Admin\Desktop\test\test.exe" start= auto error= ignore
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:
[SC] StartService FAILED 1053:
The service did not respond to the start or control request in a timely fashion.
Run Code Online (Sandbox Code Playgroud)