• 上传文件(文件另存为,有指定的路径)


    private SellerInfo uploadFile()     {         SellerInfo sellerInfo = new SellerInfo();

            String filePath = Server.MapPath("~/" + SellerReservatBL.SELLER_INFO_FILE);

            sellerInfo.ID = Request.QueryString["ID"];         sellerInfo.Sup_No = this.Sup_No.Text;         sellerInfo.Site_No = this.DlistStore.Text;         sellerInfo.EntryDate = this.ReservationDate.Text;         sellerInfo.SellerName = this.SellerName.Text;         sellerInfo.CardId = this.CardId.Text;         sellerInfo.Phone = this.Phone.Text;         sellerInfo.Brand = this.Brand.Text;         sellerInfo.OnlinePurchase = this.OnlinePurchase.Text;         sellerInfo.BussinessName = this.BussinessName.Text;         sellerInfo.BussinessPhone = this.BussinessPhone.Text;

            if (string.IsNullOrEmpty(this.FileUrl.Text))         {             if (!Directory.Exists(filePath + "/" + GetLoginUserNo()))             {                 Directory.CreateDirectory(filePath + "/" + GetLoginUserNo());             }

                if (string.IsNullOrEmpty(sellerInfo.ID))             {                 sellerInfo.ID = sellerBL.GetNextID("SellerInfo", "ID");             }

                HttpFileCollection hfc = Request.Files;             for (int i = 0; i < hfc.Count; i++)             {                 HttpPostedFile hpf = hfc[i];                 if (hpf.ContentLength > 0)                 {                     sellerInfo.AdjunctURL = filePath + "/" + GetLoginUserNo() + "/" + sellerInfo.Sup_No + "_" + sellerInfo.Site_No + "_" + sellerInfo.ID + ".rar";                 }             }

                for (int i = 0; i < hfc.Count; i++)             {                 HttpPostedFile hpf = hfc[i];                 if (hpf.ContentLength > 0)                 {                     hpf.SaveAs(sellerInfo.AdjunctURL);                 }             }         }         else         {             sellerInfo.AdjunctURL = this.FileUrl.Text;         }

            return sellerInfo;     }

  • 相关阅读:
    04.安全-TLS1.2连接过程
    02.安全-证书和CA
    01.安全-加密
    00.https基本
    00.二叉树基本
    二分查找01.基本二本查找及其变种
    01.数据结构资料,时间复杂度空间复杂度(数据结构算法基本)
    从 CentOS 8 平滑迁移至 CentOS Stream
    identityserver使用记录
    vs2019 使用私钥进行连接时出错 ssh连接报错
  • 原文地址:https://www.cnblogs.com/Carri/p/5405144.html
Copyright © 2020-2023  润新知