ASP.Net页面访问另一台服务器上的目录

发布于 2024-08-07 20:19:28 字数 317 浏览 0 评论 0 原文

我需要让 aspx.cs 文件运行代码来完全枚举另一台服务器上的目录内容。基本上,使用 Directory 对象等。

这是我可以拼凑的内容(我真的根本不是网络权利人员,所以这对我来说都很困惑。)当用户加载我的 aspx 页面时,该页面、代码后面,实际上是在某种windows用户帐户下运行的。 IUSR_什么的。

由于某种原因,我需要访问的服务器(它是 Page Flex 服务器)不允许我更改“位置”来搜索用户,因此我无法找到 /IUSR... 并为其授予权限。

当我尝试枚举远程服务器目录的内容时,是否有某种方法可以传递凭据?

我真的希望这是有道理的。

I need to let an aspx.cs file run code to enumerate the contents of a directory on another server altogether. Basically, use a Directory object, etc.

Here is what I can piece together (I'm really not a network rights guy at all, so this is all confusing to me.) When a user loads my aspx page, that page, code behind, is actually running under some kind of windows user account. IUSR_ or something.

For some reason, the server I need to reach (it's a Page Flex server) will not let me change the "Location" to search for users in so I can't go find /IUSR... and give it rights.

Is there some way to pass credentials as I try to enumerate the contents of a remote server's directories?

I really hope that made sense.

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

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

发布评论

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

评论(1

温暖的光 2024-08-14 20:19:28

我不知道您所有的安全限制,但您可能想研究一下委托

http://msdn.microsoft.com/en-us/library/aa291350(VS.71).aspx

如果您搜索谷歌,还有很多其他文章

编辑:< /strong>

来自:http://msdn.microsoft。 com/en-us/library/xh507fc5(VS.71).aspx

<!-- Web.config file. -->
<identity impersonate="true" userName="contoso\Jane" password="pass"/>

这个想法是让 Web 请求作为有权访问共享的任何域用户运行,而不是默认的(IUSR_* 或 ASPNET 用户) ,我不记得了)

我相信如果您想限制以该用户身份运行的脚本,您可以仅对子目录或脚本执行此操作,请参阅http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx

<location path="ReadUNC.aspx">
    <system.web>
        <identity impersonate="true" userName="contoso\Jane" password="pass"/>
     </system.web>
</location>

如果你想以编程方式进行模拟,也许这个将帮助您开始:http://www.west-wind.com/ WebLog/posts/1572.aspx

I don't know all your security constraints, but you may want to look into delegation

http://msdn.microsoft.com/en-us/library/aa291350(VS.71).aspx

There's lots of other articles on it if you search google

EDIT:

From: http://msdn.microsoft.com/en-us/library/xh507fc5(VS.71).aspx

<!-- Web.config file. -->
<identity impersonate="true" userName="contoso\Jane" password="pass"/>

The idea is to have the web request run as whatever domain user does have access to the share, instead of the default (IUSR_* or ASPNET user, I can't remember)

I believe you can do this for just a subdirectory or script if you want to limit what scripts are running as this user, see http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx

<location path="ReadUNC.aspx">
    <system.web>
        <identity impersonate="true" userName="contoso\Jane" password="pass"/>
     </system.web>
</location>

And if you want to do the impersonation programmatically, maybe this will help get you started: http://www.west-wind.com/WebLog/posts/1572.aspx

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