/// <summary>
/// 上传文件--返回保存的文件名
/// </summary>
private string UpFile()
{
//FileUpload为Html的文件上传控件
HttpPostedFile hpf=FileUpload.PostedFile;
char[] sep={'\\'};
string[] AFileName=hpf.FileName.Split(sep);
string GetFileName=AFileName[AFileName.Length-1];
string ServerPath=Server.MapPath(@".\UpFiles\");
if(!Directory.Exists(ServerPath))
{
Directory.CreateDirectory(ServerPath);
}
string RFileName=DateTime.Now.ToString("yyyyMMddHHmmss")+GetFileName;
string path=ServerPath+RFileName;
hpf.SaveAs(path);
return RFileName;
}