The Server state is locked. C# in windows service, So I try use :
Process.Start("shutdown -r");
But looks like it's not working....
Is there any good way to Restart , Shutdown, Lock, Unlock use C# in windows service?
I don't know what restrictions apply for a windows service to spawn a child process.. For your needs, it may be worth trying and make a difference if you call the windows APIs directly.
See which one might suit your needs from - http://msdn.microsoft.com/en-us/library/windows/desktop/aa376883(v=vs.85).aspx
http://pinvoke.net/ 을 사용 하여 .net 앱에서 거의 모든 Win API 함수를 선언하는 방법을 찾을 수 있습니다 .
도움이 되었기를 바랍니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다