积极答复者
Visual Studio建立项目后,运行时,系统弹出‘用户账户控制’提示对话框?

问题
答案
-
不建议采纳 编程志愿者的 建议.
UAC本身就是针对程序运行时须先获得用户权限. 编程志愿者的建议 关闭了这个检查, 正如windows的描述: 不推荐.
对于.net的代码,是可以在win7环境下运行而不弹出对话框的,前提是你的代码没有对系统做任何更改,或者没有 requestedExecutionLevel 设的不是 asInvoker。
现在你得到这个对话框,也就表明你的代码有对系统做更改。
以上结论在win7 64bit下测试得到。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Mike FengModerator 2012年11月23日 11:41
-
>>对于你说的 requestedExecutionLevel 设的不是 asInvoker。 这个我不懂是什么???
你可以打开你的mainfest文件看看,其官方文档再这里: http://msdn.microsoft.com/zh-cn/library/bb530410.aspx
它可以显式的要求是否需要获取管理员权限。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 MangoNic 2012年11月27日 1:13
全部回复
-
大家好,
我在VS2005中新建项目,WinForm或控制台应用程序。
生成成功后,运行,这是操作系统(Windows 7)弹出 ‘用户账户控制’ 提示对话框。
但是有时候新建项目,它就不会出现以上情况,不知道这是什么原因引起的?
各位有遇到这种问题吗? 是什么原因?怎么解决?
Thanks!!!
- 已合并 Sheng Jiang 蒋晟Moderator 2013年6月3日 20:50
-
這是WinVista/Win7/Win8 UAC問題,當你的程式會做以下的一些例子動作,UAC便會出來要你輸入Admin 權力
1) 讀寫東西去Program Files
2) 讀寫東西去Windows 文件夾
3) 讀寫東西去Users 文件夾
4) 讀寫東西去 Registry等等。
所以你要改一下你的程式的設計。
大家一齊探討、學習和研究,謝謝!
MCSD, MCAD, MCSE+I, MCDBA, MCDST, MCSA, MCTS, MCITP, MCPD,
MCT, Microsoft Community Star(TW & HK),
Microsoft MVP for VB.NET since 2003
My MSMVP Blog -
不建议采纳 编程志愿者的 建议.
UAC本身就是针对程序运行时须先获得用户权限. 编程志愿者的建议 关闭了这个检查, 正如windows的描述: 不推荐.
对于.net的代码,是可以在win7环境下运行而不弹出对话框的,前提是你的代码没有对系统做任何更改,或者没有 requestedExecutionLevel 设的不是 asInvoker。
现在你得到这个对话框,也就表明你的代码有对系统做更改。
以上结论在win7 64bit下测试得到。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Mike FengModerator 2012年11月23日 11:41
-
>>对于你说的 requestedExecutionLevel 设的不是 asInvoker。 这个我不懂是什么???
你可以打开你的mainfest文件看看,其官方文档再这里: http://msdn.microsoft.com/zh-cn/library/bb530410.aspx
它可以显式的要求是否需要获取管理员权限。
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 MangoNic 2012年11月27日 1:13