从 ASP.NET 访问 Windows 共享
我需要将文件写入不属于 ASP.net 域的计算机上的 Windows 共享。
我尝试过实施模拟,例如: http://support.microsoft.com/?id=306158< /a> 包装 LogonUserA api 调用。但有些东西不起作用,我不知道为什么。 (它似乎没有给出任何错误代码或原因消息...)
我认为这是因为远程计算机不在域上。 ?我不知道。
我无法使用“在两台机器上匹配本地用户/通行证”技巧,有人可以帮忙吗?
I need to write a file to a windows share on a computer not part of a domain from ASP.net.
I've tried implementing impersonation like : http://support.microsoft.com/?id=306158 which wraps the LogonUserA api call. Something isn't working though, and I don't know why. (It doesn't seem to give any error code or reason message...)
I think it's because the remote computer is NOT on a domain. ? I don't know.
I can't use the "matching local user/pass on both machines" trick, can someone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从我对此的回答 问题,尝试一下:
我非常喜欢Mark Brackett的回答,以至于我自己快速实施了。如果其他人急需的话,这就是:
From my answer on this question, give this a try:
I liked Mark Brackett's answer so much that I did my own quick implementation. Here it is if anyone else needs it in a hurry:
几年前我必须这样做,我能找到的唯一方法是使用 WNetAddConnection API 从代码中实际映射网络驱动器。 CodeProject 为此有一个托管包装,但我自己没有使用过它。它可能有助于您入门。
I had to do this a few years ago and the only way I could find was to actually map the network drive from code using the WNetAddConnection API. CodeProject has a managed wrapper for this, but I haven't used it myself. It might help to get you started.