我无法使用FileUpload.SaveAs()或File.WriteAllText()将文件保存在Web服务器上。我保存在该文件夹是文件模式666.无法在网络服务器上保存文件:System.UnauthorizedAccessException
我的代码是这样的:
File.WriteAllText( “” 在MapPath()+ “\\ \\广告test.jpg放在”, “测试”);
此代码在Dev中完美工作。服务器。
最好的问候, 拉塞Espeholt
System.UnauthorizedAccessException:对路径*”被拒绝。 (System.IO.FileStream.Init(String path,FileMode mode,FileAccess access,Int32 rights,Boolean useRights,FileShare share,Int32 bufferSize,FileOptions options,System.IO)中的错误代码为 。Error.WinIOError(Int32 errorCode,String maybeFullPath) at System.IO.FileStream.Init SECURITY_ATTRIBUTES secAttrs,String msgPath,Boolean bFromProxy at System.IO.FileStream..ctor(String path,FileMode mode,FileAccess access,FileShare share,Int32 bufferSize,FileOptions options,String msgPath,Boolean bFromProxy) at System.IO。 FileStream..ctor(String path,FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at System.Web.UI.WebControls.FileUpload.SaveAs(String filename) at *(Object sender,ListViewInsertEventArgs e )
访问路径*'被拒绝 - 这是一个实际的错误还是您从异常中删除了路径? – 2009-07-21 08:17:20