if (FileUpload1.HasFile)
{
string strType=FileUpload1.PostedFile.ContentType;
if (strType == "image/bmp" || strType == "image/jpeg" || strType == "image/png" || strType == "image/gif")
{
string strFileName = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
FileUpload1.SaveAs(Server.MapPath("images/" + strFileName + strType.ToString()));
Image1.ImageUrl = "images/" + strFileName + strType.ToString();
Response.Write("上传成功!");
}
else
{
Response.Write("文件类型不正确!");
}
}
else
{
Response.Write("请选择文件");
}
应该怎样去改,求解