Asp.Net文件保存至其它电脑...
Asp.Net保存文件(如Txt,Excel)至局域网中其它电脑(strPath1=”\\Computer1\Folder\”)中。
在本机测试时﹐可浏览并正常保存﹔
但在其它电脑中访问时﹐提示输入用户名与密码?
----------------------------------------------------------------------
strPath1=”\\Computer1\Folder\””
StreamWriter rw=File.CreateText(@""+strPath1+"text.txt");
Application.Lock();
rw.WriteLine(“test”);
Application.UnLock();
rw.Flush();
rw.Close();
----------------------------------------------------------------------
WEB.CONFIG设置﹕
<identity impersonate="true" />
问题点数:20、回复次数:1Top
1 楼rejoice123()回复于 2006-03-02 10:05:34 得分 0
System.UnauthorizedAccessException: 拒絕存取路徑 "\\Computer1\Folder\2006.txt"。 at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append) at System.IO.File.Top




