[asp]代码库
///
/// 上传文件的根目录
///
private string bootPath = HttpContext.Current.Request.PhysicalApplicationPath + "Files\\";
protected void btnSubmit_Click ( object sender, EventArgs e )
{
if ( file_note.HasFile )
{
//判断文件是否小于10Mb
if ( file_note.PostedFile.ContentLength < 10485760 )
{
string fileForm = file_note.FileName.Split ( '.' ) [file_note.FileName.Split ( '.' ).Length - 1];
string filePath = bootPath + string.Format ( "{0:yyyyMMddHHmmss}", DateTime.Now ) + "." + fileForm;
file_note.PostedFile.SaveAs ( filePath );
DataSet a = CommonClassLib.ExcelHelper.ReturnDataSetFromExcelFile ( filePath );
Response.Write ( "" );
}
}
}
by: 发表于:2017-11-14 10:32:25 顶(0) | 踩(0) 回复
??
回复评论