Tuesday 15 September 2015

c# - Why can't I write to the console when the requestedExecutionLevel is requireAdministrator? -


I do not want to run a window console application with the requested execution level as "needAdministrator", but then it Not printing I write the statement specified in my code

Thanks in advance!

Thank you in advance!

  Fixed zero main (string [] args) {console. Write ("Hello World" + Environmental New Line); }   

And the code it's exposed contains this code ...

  & lt; The requested exclusion level level = "requireAdministrator" uiAccess = "false" />    

When you start the command prompt as an administrator, the console writes However, when you start the command prompt as a normal user, the app will use the UAC to make a request for administrator rights, and then the console does not write any output.

- & gt; Start command prompt as admin

No comments:

Post a Comment