简单的 .net 文件上传 C#代码
public void Upload(FileUpload fu)
{
string temppath = HttpContext.Current.Request.PhysicalApplicationPath + "tempdata";
if (System.IO.Directory.Exists(temppath))
{
//
}
else
{
//
System.IO.Directory.CreateDirectory(temppath);
}
if (fu.HasFile)
{
fu.SaveAs(temppath+"//"+fu.FileName.Substring(fu.FileName.LastIndexOf("//")+1));
}
}