欧美成人精品手机在线观看_69视频国产_动漫精品第一页_日韩中文字幕网 - 日本欧美一区二区

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

[點晴永久免費(fèi)OA]C#程序B/S打包下載

admin
2020年3月3日 1:38 本文熱度 2717

      protected void btnAdd_Click(object sender, EventArgs e)
        {
            // 創(chuàng)建臨時文件夾
            string Folder = DateTime.Now.ToString("yyyymmddHHMMss");
            string tempFolder = Path.Combine(Server.MapPath("/file"), Folder);
            Directory.CreateDirectory(tempFolder);
            string[] fs = Directory.GetFiles(Server.MapPath("/files"));
            for (int i = 0; i < fs.Length; i++)
            {
                File.Copy(fs[i], tempFolder + fs[i].Substring(fs[i].LastIndexOf(''\\''), fs[i].Length - fs[i].LastIndexOf(''\\'')));
            }

            //產(chǎn)生RAR文件,及文件輸出
            RARsave(tempFolder, tempFolder, Folder);
            ResponseFile(tempFolder + @"\" + Folder + ".rar");
        }
        public void RARsave(string patch, string rarPatch, string rarName)
        {
            String the_rar;
            RegistryKey the_Reg;
            Object the_Obj;
            String the_Info;
            ProcessStartInfo the_StartInfo;
            Process the_Process;
            try
            {
                the_Reg = Registry.ClassesRoot.OpenSubKey(@"WinRAR");
                the_Obj = the_Reg.GetValue("");
                the_rar = the_Obj.ToString();
                the_Reg.Close();
                the_rar = the_rar.Substring(1, the_rar.Length - 7);
                Directory.CreateDirectory(patch);

                //命令參數(shù)
                //the_Info = " a    " + rarName + "  " + @"C:Test?70821.txt"; //文件壓縮
                the_Info = " a " + rarName + "  " + patch + "  -r";
                the_StartInfo = new ProcessStartInfo();
                the_StartInfo.FileName = "WinRar";//the_rar;
                the_StartInfo.Arguments = the_Info;
                the_StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

                //打包文件存放目錄
                the_StartInfo.WorkingDirectory = rarPatch;
                the_Process = new Process();
                the_Process.StartInfo = the_StartInfo;
                the_Process.Start();
                the_Process.WaitForExit();
                the_Process.Close();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        protected void ResponseFile(string fileName)
        {

            FileInfo fileInfo = new FileInfo(fileName);
            Response.Clear();
            Response.ClearContent();
            Response.ClearHeaders();
            Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
            Response.AddHeader("Content-Length", fileInfo.Length.ToString());
            Response.AddHeader("Content-Transfer-Encoding", "binary");
            Response.ContentType = "application/octet-stream";
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
            Response.WriteFile(fileInfo.FullName);
            Response.Flush();
            string tempPath = fileName.Substring(0, fileName.LastIndexOf("\\"));
            DelDir(tempPath);
            Directory.Delete(tempPath);
            Response.End();
         
          
        }
        private void DelDir(string path)
        {
            string[] fs = Directory.GetFiles(path);
            for (int i = 0; i < fs.Length; i++)
            {
                File.Delete(fs[i]);
            }
              
        }


該文章在 2020/3/3 1:38:32 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場、車隊、財務(wù)費(fèi)用、相關(guān)報表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點,圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved