如何在Windows 7的程序文件目录中创建和保存文件? [英] How can I create and save file in Program File directory in Windows 7?
本文介绍了如何在Windows 7的程序文件目录中创建和保存文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有程序在启动时显示注册窗口。
当我设置登录和密码时,程序必须在Program File / SomeProgram目录中创建一些文件。
我需要此程序的管理员权限。
I have the program that show the registration window when it was started. When I set login and password the program must create some file in Program File/SomeProgram directory. I need administrator rights for this program.
如果程序未注册,如何运行具有管理员权限的程序?
所以我需要设置管理员权限,当我创建文件。我需要一些示例代码。
How can I run program with administrator rights if program isn't registered? So I need set administrator rights when I create file. I need some example code.
推荐答案
您可能考虑写入CommonAppData特殊文件夹,而不是程序文件。
You might consider writing to CommonAppData special folder, instead of Program Files.
这篇关于如何在Windows 7的程序文件目录中创建和保存文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文