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

遠程服務器返回錯誤:227 Entering Passive Mode (500 oo

The remote server returned an error: 227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)(遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)) - IT屋-程序員軟件開發技術分享社
本文介紹了遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我在將 Windows 服務連接到 FTP 站點時遇到問題.

I am having a problem connecting a Windows service to an FTP site.

我從另一個開發人員那里繼承了一項 Windows 服務.該服務連接到第 3 方服務器,下載 csv 文件,然后對其進行處理.由于某種原因,該服務停止工作(一年多以前,在我獲得項目之前).

I inherited a Windows service from another developer. The service connects to a 3rd party server, downloads a csv file and then processes it. For some reason, the service stopped working (well over a year ago, before I was given the project).

所以我回到了基礎,創建了一個控制臺應用程序,并僅在該應用程序中嘗試了連接/文件下載功能.我嘗試了許多不同的方法來連接到 FTP,但它們都向我的應用程序返回相同的錯誤:

So I went back to basics, created a console app and tried the connection/ file download function only in that app. I have tried many different methods to connect to the FTP, but all of them return the same error to my application:

遠程服務器返回錯誤:227 Entering Passive Mode ()

The remote server returned an error: 227 Entering Passive Mode ()

這是我嘗試過的眾多方法之一:

This is one of the many methods I've tried:

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://ftpaddress/filename.csv");
        request.Method = WebRequestMethods.Ftp.DownloadFile;

        request.Credentials = new NetworkCredential("username", "password");

        request.UsePassive = true;

        FtpWebResponse response = (FtpWebResponse)request.GetResponse();

        Stream responseStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(responseStream);
        Console.WriteLine(reader.ReadToEnd());

        Console.WriteLine("Download Complete, status {0}", response.StatusDescription);

        reader.Close();
        response.Close(); 

但它落在這部分:

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

我在幾個論壇中看到將 UsePassive 屬性設置為 False 可以修復這些錯誤,但發生在我身上的只是我得到了一個語法錯誤,如下所示:

I read in several forums that setting the UsePassive property to False fixes these errors, but all that happened to me was that I got a syntax error instead, as below:

遠程服務器返回錯誤:(500) 語法錯誤,命令無法識別.

The remote server returned an error: (500) Syntax error, command unrecognized.

該文件托管在我無法控制的第 3 方 FTP 服務器上.我可以將 URL 粘貼到瀏覽器中,系統會提示我輸入用戶名和密碼,然后我就可以通過并下載文件.

The file is hosted on a 3rd party FTP server I have no control over. I can paste the URL into a browser, and I am prompted for a username and password, which then allows me through and I can download the file.

為了消除我們的防火墻作為問題的原因,我在內部網絡和 WiFi(不在防火墻后面)上運行了該應用程序,這沒有任何區別.我還在默認、主動和被動模式下通過 FileZilla 進行連接,并且每次都能正常工作.所以沒有問題.

To eliminate our firewall as the cause of the problem, I ran the app on both the internal network and the WiFi (which isn't behind the firewall), and it makes no difference. I also connected through FileZilla in Default, Active and Passive modes, and it worked every time. So no problem there.

然后我運行了 Wireshark.這是在被動模式下使用 Filezilla(即成功的)捕獲線路的圖像:

So then I ran Wireshark. Here is an image of the wire capture using Filezilla (i.e. a successful one), in Passive mode:

這是使用應用程序連接(和失敗)時的捕獲,被動設置為 true:

And here is the capture when connecting (and failing) using the app, with passive set to true:

所以正如您在上面的失敗連接中看到的那樣,我可以很好地登錄服務器.然后無論出于何種原因發送了一個額外的請求,即TYPE I",它提示切換到二進制模式"的響應.在下面,我得到以下內容:

So as you can see in the failed connection above, I can log in to the server just fine. Then for whatever reason an extra request is sent, namely "TYPE I", which prompts the response of "Switching to binary mode." The below that, I get the following:

500 oops:vsf_sysutil_recv_peek:無數據

500 oops: vsf_sysutil_recv_peek: no data

另外我也把Passive屬性設置為false后又跑了一次,這就是我當時得到的:

In addition, I also ran it again after setting the Passive property to false, and this is what I got that time:

所以我的問題是雙重的;

So my question is twofold;

1,如果我以某種方式解決了 UsePassive 問題并將該屬性設置為 false,那會解決我的問題嗎?

1, if I somehow get past the UsePassive issue and set that property to false, will that solve my problem?

2,忽略 UsePassive 屬性,為什么我不能從應用程序下載文件,但可以從其他地方下載文件?

2, ignoring the UsePassive property, why can't I download the file from the app, but can from everywhere else?

推薦答案

問題現已解決.原來是卡巴斯基的內置防火墻阻止了連接.很煩人,當我嘗試連接時它沒有向我顯示警告,但知道我的電腦是安全的.

The issue is now resolved. It turned out to be Kaspersky's built-in firewall that was blocking the connection. It's annoying that it didn't present me with a warning when I tried to connect, but reassuring to know my PC is safe.

線索在 227 返回的細節中:

The clue was in the detail of the 227 return:

10051 – 嘗試對無法訪問的網絡進行套接字操作

10051 – A socket operation was attempted to an unreachable network

此外,對于通過 Google 等訪問此內容的任何人,遠程服務器被配置為僅允許被動連接,這就是我收到 500 語法錯誤的原因.研究下載文件時的 Wire 捕獲發現,如果選擇 Active 但失敗,Filezilla 實際上會自動恢復到 Passive 模式.

Also, for anyone reaching this via Google etc, the remote server was configured to only allow Passive connections, which is why I was getting the 500 syntax error. Studying a Wire capture when downloading a file revealed that Filezilla actually reverts to Passive mode automatically if Active is selected but fails.

我原來帖子中的代碼現在可以正常工作了.

The code in my original post works fine now.

這篇關于遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 欧美视频区| 九九亚洲| 日韩和的一区二区 | 精品一区二区三区91 | 在线观看国产三级 | 懂色一区二区三区免费观看 | 国产精品一区二区三区在线 | 国产欧美精品 | 麻豆久久久9性大片 | 一区二区三区韩国 | 在线免费中文字幕 | 国产区视频在线观看 | 久久综合一区 | av在线免费观看网站 | 日韩精品久久久 | 欧美日韩国产精品一区二区 | 中文一区 | 91久久| 欧美日韩中文字幕在线 | 日韩中文字幕在线观看 | 天天拍天天操 | 国产情侣久久 | 国产成人亚洲精品自产在线 | 欧美在线一区二区三区 | 久热9| 午夜精品久久久久久久99黑人 | 午夜国产精品视频 | 亚洲欧美一区二区三区国产精品 | 久久高清 | 精品久久久久久久久久久久 | 日批av | 亚洲狠狠爱一区二区三区 | 欧美精品久久 | 国产激情精品一区二区三区 | 国产精品一区二区不卡 | 精品国产一级 | 一区二区三区不卡视频 | 国产精品一区二区av | 久热国产在线 | 成人精品久久 | 亚洲欧洲精品一区 |