我需要让 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.
发布评论
评论(1)
我不知道您所有的安全限制,但您可能想研究一下委托
http://msdn.microsoft.com/en-us/library/aa291350(VS.71).aspx
如果您搜索谷歌,还有很多其他文章
编辑:< /strong>
来自:http://msdn.microsoft。 com/en-us/library/xh507fc5(VS.71).aspx
这个想法是让 Web 请求作为有权访问共享的任何域用户运行,而不是默认的(IUSR_* 或 ASPNET 用户) ,我不记得了)
我相信如果您想限制以该用户身份运行的脚本,您可以仅对子目录或脚本执行此操作,请参阅http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx
如果你想以编程方式进行模拟,也许这个将帮助您开始: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
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
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