首页 > 代码库 > 文件上传

文件上传

asp 控件

 

string FullName = FileUpload1.PostedFile.FileName;//获取路径名
            if (FullName == "")
            {
                this.lbl.Text = "请选择excel文件!";
                return;

            }
            FileInfo fi = new FileInfo(FullName);
            string name = DateTime.Now.ToString("yyyyMMddHHmmssffff")+"_"+ fi.Name;
            string type = fi.Extension;
            string SavePath = Server.MapPath("~\\Upload\\Client") + "\\" + name;
            this.FileUpload1.PostedFile.SaveAs(SavePath);
            string result=crmClient.ExcelToParse(SavePath);

文件上传