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

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

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

      1. 為什么 FtpWebRequest 為這個現有目錄返回一個空流

        Why does FtpWebRequest return an empty stream for this existing directory?(為什么 FtpWebRequest 為這個現有目錄返回一個空流?)

              <tbody id='5olAc'></tbody>
            • <bdo id='5olAc'></bdo><ul id='5olAc'></ul>
              <tfoot id='5olAc'></tfoot>
            • <legend id='5olAc'><style id='5olAc'><dir id='5olAc'><q id='5olAc'></q></dir></style></legend>
              • <small id='5olAc'></small><noframes id='5olAc'>

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

                • 本文介紹了為什么 FtpWebRequest 為這個現有目錄返回一個空流?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  I'm not sure why am I getting this result. I'm running this on a Linux server. (It's my small web site's shared web hosting account.)

                  The files are grouped as follows:

                  and the Another Dir has one file inside:

                  So I'm trying to retrieve the contents of the badname directory inside 1somelongdir1234567 directory that doesn't exist on the server, using this code:

                  try
                  {
                      FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(
                          "ftp://server12.some-domain.com/public_html/1somelongdir1234567/badname");
                      ftpRequest.EnableSsl = true;
                      ftpRequest.Credentials = new NetworkCredential("user", "password");
                      ftpRequest.KeepAlive = true;
                      ftpRequest.Timeout = -1;
                  
                      ftpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
                  
                      using (FtpWebResponse response1 = (FtpWebResponse)ftpRequest.GetResponse())
                      {
                          //*****BEGIN OF EDIT*****
                          Console.WriteLine(response1.StatusDescription);
                          Console.WriteLine(response1.StatusCode);
                          //*****END OF EDIT*****
                  
                          using (StreamReader streamReader = new StreamReader(response1.GetResponseStream()))
                          {
                              List<string> arrList = new List<string>();
                  
                              for (; ; )
                              {
                                  string line = streamReader.ReadLine();
                  
                                  //I get to here, where `line` is null????
                  
                                  if (string.IsNullOrEmpty(line))
                                      break;
                  
                                  arrList.Add(line);
                  
                                  //*****BEGIN OF EDIT*****
                                  Console.WriteLine(line);
                                  //*****END OF EDIT*****
                              }
                          }
                      }
                  }
                  catch (Exception ex)
                  {
                      Console.WriteLine(ex.Message);
                  }
                  

                  So as you see, there's no such folder badname but instead of throwing an exception, my ftpRequest.GetResponse() succeeds and then streamReader.ReadLine() returns null like I showed in the code above.

                  More strangely, if I provide an actual directory as such:

                      FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(
                          "ftp://server12.some-domain.com/public_html/1somelongdir1234567/Another%20Dir");
                  

                  the streamReader.ReadLine() still returns null.

                  Can someone explain why?


                  Edit: OK, guys, I updated the code above to retrieve the status code. I'm still puzzled though.

                  First, here's three values of connection URI and the response/output that I'm getting:

                  Example 1:

                  //Existing folder
                  "ftp://server12.some-domain.com/public_html/1somelongdir1234567"
                  

                  Output:

                  150 Accepted data connection
                  
                  OpeningData
                  drwxr-xr-x    3 username   username         4096 Sep  5 05:51 .
                  drwxr-x---  118 username   99               4096 Sep  5 05:54 ..
                  drwxr-xr-x    2 username   username         4096 Sep  5 05:52 Another Dir
                  -rw-r--r--    1 username   username           11 Sep  5 05:51 test123.txt
                  

                  Example 2:

                  //Another existing folder
                  "ftp://server12.some-domain.com/public_html/1somelongdir1234567/Another%20Dir"
                  

                  Output:

                  150 Accepted data connection
                  
                  OpeningData
                  

                  Example 3:

                  //Nonexistent folder
                  "ftp://server12.some-domain.com/public_html/1somelongdir1234567/SomeBogusName"
                  

                  Output:

                  150 Accepted data connection
                  
                  OpeningData
                  

                  So why is it giving me the same result for example 2 as I'm getting for 3?

                  As for what ftp server it is, I wasn't able to see it in the network logs nor in FtpWebRequest itself. Here's what I was able to get from Microsoft Network Monitor:

                  Welcome to Pure-FTPd [privsep] [TLS] ----------..
                  220-You are user number 4 of 50 allowed... 220-Local time is now 13:14. Server port: 21...
                  220-This is a private system - No anonymous login..
                  220-IPv6 connections are also welcome on this server...
                  220 You will be disconnected after 15 minutes of inactivity...

                  解決方案

                  The URL for the ListDirectory/ListDirectoryDetails method should end with a slash, in general.

                  Without a slash, results tend to be uncertain.

                  WebRequest.Create("ftp://example.com/public_html/1somelongdir1234567/Another%20Dir/");
                  

                  這篇關于為什么 FtpWebRequest 為這個現有目錄返回一個空流?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='t0Hby'></tfoot>
                    <legend id='t0Hby'><style id='t0Hby'><dir id='t0Hby'><q id='t0Hby'></q></dir></style></legend>
                      <tbody id='t0Hby'></tbody>

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

                          <i id='t0Hby'><tr id='t0Hby'><dt id='t0Hby'><q id='t0Hby'><span id='t0Hby'><b id='t0Hby'><form id='t0Hby'><ins id='t0Hby'></ins><ul id='t0Hby'></ul><sub id='t0Hby'></sub></form><legend id='t0Hby'></legend><bdo id='t0Hby'><pre id='t0Hby'><center id='t0Hby'></center></pre></bdo></b><th id='t0Hby'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='t0Hby'><tfoot id='t0Hby'></tfoot><dl id='t0Hby'><fieldset id='t0Hby'></fieldset></dl></div>
                            <bdo id='t0Hby'></bdo><ul id='t0Hby'></ul>
                          • 主站蜘蛛池模板: 久久国内精品 | 国产精品久久久久久久三级 | 黄色毛片免费看 | 国产资源一区二区三区 | 欧美区在线 | 亚洲精品一区二区久 | 免费一区二区在线观看 | 久久精品国产亚洲a | 福利二区 | 色久影院 | 日韩中文字幕一区二区 | 欧美日韩在线观看视频网站 | 欧美激情一区 | 亚洲成人久久久 | 国产精品一区二区不卡 | 国产在线视频一区 | 免费激情网站 | 天天看天天摸天天操 | 国产中文字幕在线观看 | 三级黄色片在线观看 | 亚洲精品国产综合区久久久久久久 | 最近日韩中文字幕 | 国产精品一区二区三 | 日韩电影免费在线观看中文字幕 | 亚洲精品一区二区二区 | 99成人精品 | 国产精品一区在线观看你懂的 | 毛片一区二区三区 | 久久国产精品72免费观看 | 91精品国产综合久久久久久 | 欧美精品一区二区三区四区五区 | av网址在线 | 亚洲一区二区精品 | 国产视频一区二区 | 日韩网站免费观看 | 欧美成视频在线观看 | 亚洲成人激情在线观看 | 中文成人在线 | 夜夜久久| 成人乱人乱一区二区三区软件 | 中文字幕一级 |