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

后端 未结 4 730
情歌与酒
情歌与酒 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:24

    You need to add "Application Manifest File". Step-By-Step

    • Right-Click on your project
    • Add "New Item"
    • Select "Application Manifest File"
    • Find this
    • change level="requireAdministrator"

提交回复
热议问题