Click here to Skip to main content
15,886,801 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created a trusted app in silverlight to shutdown a pc with ExitWindowsEx() still getting method access exception method must be security critical or security safe critical,please help me.
Posted

1 solution

There is already a system command line tool to trigger a restart / halt / logoff on a local or remote machine.

For example, if you want to halt a remote computer named TESTCOMPUTER, the command line is the following:
shutdown.exe -m \\TESTCOMPUTER -s -f -t 0

Of course, this command line will have to be executed by an administrative account.

Using a silverlight app for this specific purpose is nonsense, IMHO.
 
Share this answer
 
Comments
Vijay M 15-Apr-14 6:11am    
I already completed developing the app.This is the last requirement to complete the project.Pls let me know if u have any solutions in silverlight.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900