且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

程序无法访问程序文件中的文件

更新时间:2023-11-19 22:39:34

在Windows7上,程序文件文件夹受UAC保护,因此要在该文件夹中写入,需要管理员权限(以及UAC确认).

***将数据"写入用户的本地配置文件文件夹,为此请使用Environment变量: ^ ]
On Windows7 the "Program Files" folder is protected by the UAC, so to write there you need administrator privileges (and the UAC confirmation).

It is better to write "data" to the user''s local profile folders instead, use the Environment variable for this : http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx[^]


访问路径``C:\ Program Files(x86)\ xPro \ Friends.txt''被拒绝.
没有适当的安全特权.您需要确保具有写权限.此外,如果文本文件被标记为只读,则只有在可写之前,您才能对其进行编辑.
Access to the path ''C:\Program Files (x86)\xPro\Friends.txt'' is denied.
Proper security privileges are not in place. You need to make sure that write permissions are in place. Further, if the text file is marked readonly, you cannot edit it until it is writable.