久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='ScbeV'></tfoot>

    <small id='ScbeV'></small><noframes id='ScbeV'>

  • <i id='ScbeV'><tr id='ScbeV'><dt id='ScbeV'><q id='ScbeV'><span id='ScbeV'><b id='ScbeV'><form id='ScbeV'><ins id='ScbeV'></ins><ul id='ScbeV'></ul><sub id='ScbeV'></sub></form><legend id='ScbeV'></legend><bdo id='ScbeV'><pre id='ScbeV'><center id='ScbeV'></center></pre></bdo></b><th id='ScbeV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ScbeV'><tfoot id='ScbeV'></tfoot><dl id='ScbeV'><fieldset id='ScbeV'></fieldset></dl></div>

          <bdo id='ScbeV'></bdo><ul id='ScbeV'></ul>

        <legend id='ScbeV'><style id='ScbeV'><dir id='ScbeV'><q id='ScbeV'></q></dir></style></legend>
      1. 壓縮目錄并上傳到 FTP 服務器,而無需在 C# 中本

        Zip a directory and upload to FTP server without saving the .zip file locally in C#(壓縮目錄并上傳到 FTP 服務器,而無需在 C# 中本地保存 .zip 文件)

        <i id='TzzKw'><tr id='TzzKw'><dt id='TzzKw'><q id='TzzKw'><span id='TzzKw'><b id='TzzKw'><form id='TzzKw'><ins id='TzzKw'></ins><ul id='TzzKw'></ul><sub id='TzzKw'></sub></form><legend id='TzzKw'></legend><bdo id='TzzKw'><pre id='TzzKw'><center id='TzzKw'></center></pre></bdo></b><th id='TzzKw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TzzKw'><tfoot id='TzzKw'></tfoot><dl id='TzzKw'><fieldset id='TzzKw'></fieldset></dl></div>

              <tfoot id='TzzKw'></tfoot>
            • <small id='TzzKw'></small><noframes id='TzzKw'>

              • <legend id='TzzKw'><style id='TzzKw'><dir id='TzzKw'><q id='TzzKw'></q></dir></style></legend>
                  <bdo id='TzzKw'></bdo><ul id='TzzKw'></ul>

                    <tbody id='TzzKw'></tbody>
                  本文介紹了壓縮目錄并上傳到 FTP 服務器,而無需在 C# 中本地保存 .zip 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我的問題是標題.我試過這個:

                  My question is the title. I have tried this:

                  public void UploadToFtp(List<strucProduktdaten> ProductData)
                  {
                      ProductData.ForEach(delegate( strucProduktdaten data )
                      {
                          ZipFile.CreateFromDirectory(data.Quellpfad, data.Zielpfad, CompressionLevel.Fastest, true);
                      });
                  }
                  
                  
                  static void Main(string[] args)
                  {
                      List<strucProduktdaten> ProductDataList = new List<strucProduktdaten>();
                      strucProduktdaten ProduktData = new strucProduktdaten();
                      ProduktData.Quellpfad = @"Path	ozip";
                      ProduktData.Zielpfad = @"Link to the ftp"; // <- i know the link makes no sense without a connect to the ftp with uname and password
                  
                      ProductDataList.Add(ProduktData);
                  
                      ftpClient.UploadToFtp(ProductDataList);
                  }
                  

                  錯誤:

                  System.NotSupportedException:不支持路徑格式."

                  System.NotSupportedException:"The Path format is not supported."

                  我不知道在這種情況下我應該如何連接到 FTP 服務器并將目錄壓縮到 ram 中并將其直接發送到服務器.

                  I have no idea how I should connect in this case to the FTP server and zipping the directory in ram and send it directly to the server.

                  ...有人可以提供幫助或提供指向類似或相同問題的鏈接嗎?解決了什么?

                  ... can someone help or have a link to a similar or equal problem what was solved?

                  推薦答案

                  MemoryStream中創建ZIP壓縮包并上傳.

                  Create the ZIP archive in MemoryStream and upload it.

                  using (Stream memoryStream = new MemoryStream())
                  {
                      using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
                      {
                          foreach (string path in Directory.EnumerateFiles(@"C:sourcedirectory"))
                          {
                              ZipArchiveEntry entry = archive.CreateEntry(Path.GetFileName(path));
                  
                              using (Stream entryStream = entry.Open())
                              using (Stream fileStream = File.OpenRead(path))
                              {
                                  fileStream.CopyTo(entryStream);
                              }
                          }
                      }
                  
                      memoryStream.Seek(0, SeekOrigin.Begin);
                  
                      var request =
                          WebRequest.Create("ftp://ftp.example.com/remote/path/archive.zip");
                      request.Credentials = new NetworkCredential("username", "password");
                      request.Method = WebRequestMethods.Ftp.UploadFile;
                      using (Stream ftpStream = request.GetRequestStream())
                      {
                          memoryStream.CopyTo(ftpStream);
                      }
                  }
                  

                  不幸的是,ZipArchive 需要一個可搜索的流.如果不是這樣,您將能夠直接寫入 FTP 請求流,而無需將整個 ZIP 文件保存在內存中.

                  Unfortunately the ZipArchive requires a seekable stream. Were it not, you would be able to write directly to the FTP request stream and won't need to keep a whole ZIP file in a memory.

                  基于:

                  • 使用 System.IO.Compression 在內存中創建 ZIP 存檔
                  • 將文件從字符串或流上傳到 FTP 服務器

                  這篇關于壓縮目錄并上傳到 FTP 服務器,而無需在 C# 中本地保存 .zip 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                  <tfoot id='tHbDl'></tfoot>
                • <small id='tHbDl'></small><noframes id='tHbDl'>

                        <bdo id='tHbDl'></bdo><ul id='tHbDl'></ul>

                        1. <i id='tHbDl'><tr id='tHbDl'><dt id='tHbDl'><q id='tHbDl'><span id='tHbDl'><b id='tHbDl'><form id='tHbDl'><ins id='tHbDl'></ins><ul id='tHbDl'></ul><sub id='tHbDl'></sub></form><legend id='tHbDl'></legend><bdo id='tHbDl'><pre id='tHbDl'><center id='tHbDl'></center></pre></bdo></b><th id='tHbDl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tHbDl'><tfoot id='tHbDl'></tfoot><dl id='tHbDl'><fieldset id='tHbDl'></fieldset></dl></div>

                          • <legend id='tHbDl'><style id='tHbDl'><dir id='tHbDl'><q id='tHbDl'></q></dir></style></legend>
                              <tbody id='tHbDl'></tbody>
                            主站蜘蛛池模板: 日韩插插 | 久久精品视频网站 | 国产精品18久久久久久久 | 亚洲第一成年免费网站 | 中文字幕一区二区三区在线观看 | 黄片毛片免费看 | 国产精品69毛片高清亚洲 | 亚洲国产精品成人综合久久久 | 毛片综合 | 精品一区二区免费视频 | 日日操操| 91久久国产综合久久 | 国产综合一区二区 | 国产线视频精品免费观看视频 | 伊人网99| 国产日韩欧美一区二区在线播放 | 人人爱干| 亚洲精品电影网在线观看 | 99久久精品国产一区二区三区 | 一区二区三区在线观看免费视频 | 国产在线视频网 | 日韩一级欧美一级 | 黄色片av | 久久久免费毛片 | av大片在线观看 | 99精品国产一区二区青青牛奶 | 精品一区国产 | 国产精品久久久久久吹潮日韩动画 | 国产九九精品 | 日本粉嫩一区二区三区视频 | 色视频在线播放 | 免费av直接看 | 国产精品日日做人人爱 | 中文字幕视频在线 | 久久精品男人的天堂 | 国产小u女发育末成年 | 天天综合网永久 | 国产高清在线精品一区二区三区 | 国产在线一区二区三区 | 国产精品日韩一区二区 | 91精品免费视频 |