懂ASP.NET的桐子们,能不能来看看我用ASP.NET写了个小小的File uploading program
但是每次我click upload时,都会显示
the page cannot be displayed.
大家帮我看看为什么……
我把
代码 和 错误信息贴在这里哈
many thanks~~~
-----------------upload.aspx---------------------------------
Uploader
------------------uploader.cs----------------------------------
using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.HtmlControls;
public class UpFile : Page
{
protected HtmlInputFile IoFile;
protected String IstrFileName;
protected String IstrFileNamePath;
protected String IstrFolder;
public void UploadFile_OnClick(Object Sender,EventArgs e)
{
//IstrFolder = "F:\\phpdev\\www\\public\\UploadedFiles\\";
IstrFolder = @"C:\Inetpub\wwwroot\dev\lockers\NewBalloting";
IstrFileName = IoFile.PostedFile.FileName;
IstrFileName = Path.GetFileName(IstrFileName);
IstrFileNamePath = IstrFolder + IstrFileName;
IoFile.PostedFile.SaveAs(IstrFileNamePath);
}
}
------ (more...)
make your dir executable.