问题描述
我创建了一个基于Windows窗体的应用程序,并将一些日志详细信息写入文件logs.txt。此文件位于另一个名为Logs的文件夹中。在本地没有发现问题,但是当我创建它并安装在我的机器上时,我发现Logs目录上没有写入权限。当我给予完全许可时,它再次正常工作。
在创建Windows窗体应用程序的安装项目时,有没有办法提供完全权限?
上述问题可在Windows 7上找到。
I have created a Windows Form based application and writing some logs detail in a file as "logs.txt". This file is available in another folder named as "Logs". No issue found on local, but when i create Setup of it and install in on my machine i found that write permission is not available on "Logs" directory. When i give full permission then again it working fine.
Is there any way to provide full permission when creating an Setup project of my Windows Form application?
The above issue were found on Windows 7.
推荐答案
<security>
<requestedprivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedexecutionlevel level="requireAdministrator" uiaccess="false" />
</requestedprivileges>
</security>
谢谢
thanks
这篇关于C#Windows窗体应用程序:在创建安装程序/安装程序时为用户的目录设置写入权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!