当“运行方式”时在 Windows XP 中保存应用程序数据 “保护计算机免受未经授权的活动”

发布于 2024-07-27 14:21:08 字数 367 浏览 2 评论 0原文

我正在尝试这样做,以便当用户通过 run 运行应用程序时可以保存程序中的数据就像通过这个对话框。 我发现我实际上无法写入任何文件夹并稍后从其中读回。 我尝试过“所有用户”、应用程序数据、我的文档等,但无济于事。

当 Windows XP 阻止我的应用程序执行“未经授权的活动”时,我应该如何以及在何处保存和读取数据,有什么想法吗?

I'm trying to make it so I can save data from my program when the user is running the applicaiton through run as like through this dialogue box. I'm finding I cant actually write to any folder and read back from it later on. i've tried 'All Users', Application data, My Documents, etc but to no avail.

Any ideas how and where I am supposed to save and read data when Windows XP is keeping my application from performing 'unauthorized activity'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

剪不断理还乱 2024-08-03 14:21:08

当选中“保护”复选框时,您实际上无法在任何地方(注册表或文件系统)进行写入,这就是重点。 大多数程序在选中此选项时甚至无法运行。 它在底层使用 SAFER API。 有关详细信息,请查看此博客

When the "protect" checkbox is checked, you can't really write anywhere (registry or filesystem) and that is sort of the point. Most programs don't even run with this option checked. Under the hood it uses the SAFER API. For more info, check this blog

秉烛思 2024-08-03 14:21:08

如果您不是管理员,您可能无权使用其他用户的文件夹。 如果您想使用属于启动您的应用程序的用户的文件夹,请尝试使用 APPDATA 环境变量,该变量应保存该用户的应用程序数据文件夹的路径。 环境变量可以通过 Win32 API 或其他方法访问,具体取决于您的编程语言。

If you're not an administrator, you might not have the right to work with other users' folders. If you want to work with the folders that belong to the user who has launched your app, try using the APPDATA environment variable, which should hold the path of that user's application data folder. Environment variables are accessible via Win32 API or other methods, depending on your programming language.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文