运行使用C#Win Application创建的安装程序时访问被拒绝权限 [英] Access Denied permission when runnning setup created with C# Win Application

查看:207
本文介绍了运行使用C#Win Application创建的安装程序时访问被拒绝权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在C盘中创建了一个文本文件夹为C:\Program Files \ LogDetail \Log.txt 在C#Windows Application.It工作正常。在我创建了这个项目的设置之后。该设置适用于32位处理器但是当我在64位处理器上创建设置时,然后

访问路径C:\Program Files \LogDetail\Log.txt是拒绝



请帮助我。

如何在创建LogDetail文件夹时设置权限。 />




谢谢

Wasif

Hi All,

I have created a folder with a text file in C drive as "C:\Program Files\LogDetail\Log.txt" in C# Windows Application.It is working fine .There after I created setup of this project. The setup is working fine for 32 bit processor but when I create setup on 64 bit processor then
"Access to the path C:\Program Files\LogDetail\Log.txt is denied".

Please help me.
How to give permission during creating setup to "LogDetail" folder.


Thanks
Wasif

推荐答案

你可能在64位机器上遇到UAC权限问题。



日志文件应存储在AppData位置而不是应用程序安装位置。这是一篇MSDN文章,解释了执行此操作的方法: http:/ /msdn.microsoft.com/en-us/library/system.windows.forms.application.userappdatapath.aspx [ ^ ]



有一个非常这篇代码项目的好文章解释了UAC的进出。 (它基于Vista,但仍包含相关信息。) Vista UAC:The Definitive指南 [ ^ ]



祝你好运。
You probably running into the UAC permission issues in the 64 bit machine.

The log files should be stored in the AppData location rather than the application installation location. Here is an MSDN article that explains the methods for doing this: http://msdn.microsoft.com/en-us/library/system.windows.forms.application.userappdatapath.aspx[^]

There is an very good article here in code project that explains the ins and out of UAC. (It is based on Vista, but is still contains relevant information.) Vista UAC: The Definitive Guide[^]

Good luck.


这篇关于运行使用C#Win Application创建的安装程序时访问被拒绝权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆