<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      webservce附件下載

      using System;
      using System.IO;
      using System.Text;
      using System.Web;
      using System.Data;
      using Register.DataAccess;
      using System.Configuration;
      using HrisInterFaceProject.Helper;
      using System.Data.SqlClient;

      namespace HrisInterFaceProject.PAGE
      {
      public partial class AttachDownload : System.Web.UI.Page
      {

      protected override void OnLoad(EventArgs e)
      {
      base.Response.CacheControl = "public";
      Page_Load(this, e);
      }
      protected void Page_Load(object sender, EventArgs e)
      {
      Response.Clear();
      string logtitle = "期貨從業(yè)資格傳rpa附件下載";
      string FileName = string.Empty;
      string attachid = Request["attachid"] as string;
      string fileid = Request["fileId"] as string;
      //string ServerPath = "\\\\10.29.100.78\\vol_nfs_fcsjdkfcs\\附件\\";
      string ServerPath = ConfigurationManager.AppSettings["filepath"].ToString();

      try
      {

      if (string.IsNullOrWhiteSpace(attachid) && string.IsNullOrWhiteSpace(fileid))
      {
      Response.Write(@"<script>alert('未傳正確參數(shù)!'); </script>");
      }
      else
      {
      string type = string.Empty;
      string filetype = string.Empty;
      bool flag = false;
      string fname = string.Empty;
      if (!string.IsNullOrWhiteSpace(attachid))
      {
      string sql = $@"select sourcetype,title,filetype from skyDataFiles where id={attachid}";
      DataSet ds = new DataSet();
      ds = DbHelperSQL.Query(sql);
      type = ds.Tables[0].Rows[0]["sourcetype"].ToString();
      filetype = ds.Tables[0].Rows[0]["filetype"].ToString();
      FileName = ServerPath + "/" + attachid + "_" + ds.Tables[0].Rows[0]["title"].ToString();
      fname= ds.Tables[0].Rows[0]["title"].ToString();
      flag = true;

      }
      else
      {
      string sql = $@"select sourcetype,title,filetype from skyDataFiles where id={fileid}";
      DataSet ds = new DataSet();
      ds = DbHelperSQL.Query(sql);
      type = ds.Tables[0].Rows[0]["sourcetype"].ToString();
      filetype = ds.Tables[0].Rows[0]["filetype"].ToString();
      fname = ds.Tables[0].Rows[0]["title"].ToString();
      FileName = ServerPath + "/" + fileid + "_" + ds.Tables[0].Rows[0]["title"].ToString();

      }


      if (type == "1")
      {
      FileStream fs = new FileStream(FileName, FileMode.Open);
      byte[] bytes = new byte[(int)fs.Length];
      fs.Read(bytes, 0, bytes.Length);
      fs.Close();
      Response.ContentType = "application/octet-stream";
      //通知瀏覽器下載文件而不是打開
      Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fname, System.Text.Encoding.UTF8));
      Response.BinaryWrite(bytes);
      Response.Flush();
      Response.End();
      }
      else
      {

      Byte[] blob = null;

      using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
      {
      string blobsql = string.Empty;
      conn.Open();
      if (flag)
      {
      blobsql = $@"select layout from skyDataFiles where sourcetype=0 and id={attachid}";

      }
      else
      {
      blobsql = $@"select layout from skyDataFiles where sourcetype=0 and id={fileid}";
      }
      NLogHelper.WriteLogByCustom(logtitle, blobsql.ToString(), LogLevel.Debug, LogModelPrefix.DNJK, logtitle);
      SqlCommand cmd = new SqlCommand(blobsql, conn);
      SqlDataReader sdr = cmd.ExecuteReader();
      sdr.Read();
      blob = new Byte[(sdr.GetBytes(0, 0, null, 0, int.MaxValue))];
      sdr.GetBytes(0, 0, blob, 0, blob.Length);

      sdr.Close();
      conn.Close();
      }
      Response.ContentType = "application/octet-stream";
      //通知瀏覽器下載文件而不是打開

      Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fname, System.Text.Encoding.UTF8) + "." + HttpUtility.UrlEncode(filetype, System.Text.Encoding.UTF8));
      Response.BinaryWrite(blob);
      Response.Flush();
      Response.End();

       

      }


      }
      } catch (Exception ex)
      {
      NLogHelper.WriteLogByCustom(logtitle, "錯(cuò)誤代碼:8000012。下載接口出現(xiàn)問題,請(qǐng)重試或聯(lián)系管理員檢查!" + ex, LogLevel.Error, LogModelPrefix.DNJK, logtitle);

      }

      }

      }

      }

      posted @ 2023-03-08 08:48  泉城余文樂  Views(22)  Comments(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 深夜免费av在线观看| 日本一区二区三区四区黄色| 日本人成精品视频在线| 阿克| 亚洲精品成a人在线观看| 久久中文字幕一区二区| 欧美激情内射喷水高潮| 性色在线视频精品| 久久乐国产精品亚洲综合| 人妻激情另类乱人伦人妻| 日韩人妻一区中文字幕| 亚洲国产亚洲综合在线尤物| 国产成人精品国内自产色| 国产成人亚洲精品自产在线| 国色精品卡一卡2卡3卡4卡在线| 美女裸体视频永久免费| 日本亚洲一区二区精品久久| 精品国产乱码久久久久久浪潮| 波多结野衣一区二区三区| 成在线人永久免费视频播放| 日本高清成本人视频一区| 国产精品+日韩精品+在线播放| 日韩国产中文字幕精品| 5555国产在线观看| 国产蜜臀视频一区二区三区| 男人进女人下部全黄大色视频| 99久久无码一区人妻a黑| 欧美老人巨大XXXX做受视频| 久久av无码精品人妻出轨| 中文字幕乱码一区二区免费| 亚洲av片在线免费观看| 成人无码特黄特黄AV片在线| 啪啪av一区二区三区| 国产中年熟女大集合| 亚洲欧美综合精品成| 成年女人喷潮免费视频| 国产在线精品一区二区夜色| 日本55丰满熟妇厨房伦| 人妻中文字幕亚洲精品| 久久中文字幕一区二区| 瑞安市|