Server Error in '/' Application.
--------------------------------------------------------------------------------Access to the path 'F:\chuangxiang\manage\VI\9.jpg' is denied. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the path 'F:\chuangxiang\manage\VI\9.jpg' is denied. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: 
[UnauthorizedAccessException: Access to the path 'F:\chuangxiang\manage\VI\9.jpg' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String str) +498
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +975
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +108
   System.IO.FileStream..ctor(String path, FileMode mode) +51
   System.Web.HttpPostedFile.SaveAs(String filename) +94
   YinHeCentury1.Manage.AddWorks.bt_Add_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\YinHeCentury1\Manage\AddWorks.aspx.cs:86
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +113
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +235
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +38
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5153 
请问怎么样解决,是路径的问题吗?
我是把路径保存到数据库,图片存到文件夹的,代码如下:
string ini_path=Server.MapPath(type);
string FN=Path.GetFileName(HPF.FileName);
HPF.SaveAs(ini_path+"\\"+FN);
type是我选择的文件夹名字。
我找服务器管理员了,改了对文件夹的权限,还是出现这个问题。求救~~

解决方案 »

  1.   

    1、你确信'F:\chuangxiang\manage\VI\9.jpg'这个路径是正确的吗?
    2、如果路径正确,你应考虑权限的问题,必须给予aspnet用户删除的权限
    3、如果给了权限还无法操作,你必须考虑该文件夹是否存在所属用户的错误,如果该机器曾经重新安装过操作系统,而且在上次安装的操作系统中该文件夹曾经属于不同的管理员的话。
      

  2.   

    Access to the path 'F:\chuangxiang\manage\VI\9.jpg' is denied. 无权限
    如果是win2000系统 给Aspnet用户 该目录的写权县
    如果是win2003系统 给NetWorkService用户 该目录的写权县
      

  3.   

    你拿这个去问管理员Access to the path 'F:\chuangxiang\manage\VI\9.jpg' is denied.