private void FileUpload(System.Web.UI.WebControls.FileUpload FileUploadControl,string savePath)
{
try
{
if (FileUploadControl.HasFile)
{
string fileName = FileUploadControl.FileName;
string fileExtendName = fileName.Substring(fileName.LastIndexOf('.'));
//过滤文件后缀
if (fileExtendName.ToLower() == "xls" || fileExtendName.ToLower() == "xlsx")
{
FileUploadControl.PostedFile.SaveAs(Server.MapPath(savePath));
}
}
}
catch (Exception ex)
{
throw ex;
}
}