Start Process with administrator right in C#

后端 未结 5 1005
醉酒成梦
醉酒成梦 2020-12-06 07:04

I have to start a command line program with System.Diagnostics.Process.Start() and run it as Administrator.

This action will also be run by a Scheduled Task every da

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 07:32

    Be aware that storing a password in clear text in a program is never secure as long as someone can peruse the application and see what is in it. Using SecureString to convert a stored password into a SecureString password does not make it more secure, because the clear text password would still be present.

    The best way to use SecureString is to pass a single character for conversion at a time in someway that does not require having the complete unencrypted password anywhere in memory or on the hard drive. After that character is converted, the program should forget it, and then go on to the next.

    This could be done I think only by passing characters through for translation as they are being typed into the console by the user.

提交回复
热议问题