如何获取网络应用程序将在其下运行的用户?

发布于 2024-09-09 05:05:27 字数 183 浏览 0 评论 0原文

问题:我有一个网络设置项目。

它会安装 web 应用程序并将其放入适当的虚拟目录中。
到目前为止一切顺利。
我现在的问题是:如何设置文件夹写入权限?
我的问题是,我可以通过编程方式设置权限,但我需要知道应用程序运行的 IIS 用户,因为正是该用户需要权限。

如何获取(或设置)IIS 用户?

Question: I have a web setup project.

It installs the webapp and puts it into the appropriate virtual directory.
So far so good.
My question now is: how do I set folder write permission?
My problem is, I can set the permissions programmatically, but I need to know the IIS user the application runs under, since it's that user that need the permissions.

How can I get (or set) the IIS user ?

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

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

发布评论

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

评论(1

我不会写诗 2024-09-16 05:05:27

默认值通常为 IUSR_%machinename%

您可以尝试读取 IIS 元数据库文件,但它通常位于系统文件夹 (C:\WINDOWS\system32\inetsrv\metabase.xml) 中。找到具有正确 Location 属性的 元素,然后读取 AnonymousUserName 属性的值。我不建议直接写入元数据库。

我只熟悉 IIS6,因此上述内容可能会因版本而异。

The default value is usually IUSR_%machinename%

You could attempt to read the IIS metabase file but it's usually in a system folder (C:\WINDOWS\system32\inetsrv\metabase.xml). Find the <IIsWebService> element with the proper Location attribute and then read the value of the AnonymousUserName attribute. I don't recommend writing directly to the metabase.

I am only familiar with IIS6 so the above may vary by version.

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