c sharp exe should ask for “run as administrator” prompt when opened

后端 未结 4 734
情歌与酒
情歌与酒 2021-02-09 07:20

I am having an exe generated by a c sharp program. when i run the exe, i want an UAC prompt to appear with an option to run the exe as administrator. I have seen examples of run

4条回答
  •  情歌与酒
    2021-02-09 07:39

    You can use the ProcessStartInfo class or Windows principal to achieve this.

    You can also embed a manifest file in your application .exe and set requestedExecutionLevel property.

    There is also a way to enable/disable UAC trough the windows registry.

提交回复
热议问题