Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.IO;
Using System.Data;
Using System.Data.SqlClient;
Using Common;
Using BLL;
Namespace CRM. Ui
{
public partial class CustomerInformationUpload:System.Web.UI.Page
{
Crmclient crmclient = new Crmclient ();
protected void Page_Load (object sender, EventArgs e)
{
}
protected void Button1_Click (object sender, EventArgs e)
{
String FullName = fileupload1.postedfile.filename;//Get path name
if (FullName = = "")
{
This.lbl.Text = "Please select Excel file!" ";
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);
Upload file Background code