上週遇到的問題,由於在windows 8上面執行程式的權限越來越麻煩,有些開發好得程式還必須Run as Administrator,後來邊google邊試了半天,總算讓我研究出一個小撇步。


1. Right click on your project and choose “Properties”.
img1

2. In the “Security” tab, check the checkbox of “Enable the ClickOnce security settings”.
img2

3. After the app.manifest shows, uncheck the checkbox of “Enable the ClickOnce security settings”.
img3

4. Edit the app.manifest and change the level to requireAdministrator.
img4

  改好後,原本的porject在build後,產生的執行檔就會自動以Admin權限來執行,不過這時候又會遇到UAC的問題,如果不想一直被問,就自己去關掉吧!

Control Panel -> User Account -> Change User Account Control setting -> Never notify

或參考"How to Disable and Turn Off UAC in Windows 7"
創作者介紹

每天都有新鮮事

soarlin 發表在 痞客邦 PIXNET 留言(0) 人氣()