zoukankan      html  css  js  c++  java
  • 上传文件后台代码

    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;//获取路径名
    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);

  • 相关阅读:
    bzoj3996
    bzoj3157 3516
    bzoj1937
    bzoj1532
    bzoj3572
    bzoj1453
    bzoj3205
    bzoj2595
    关于高斯消元解决xor问题的总结
    linux查找和替换命令
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/5773577.html
Copyright © 2011-2022 走看看