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

遠(yuǎn)程服務(wù)器返回錯(cuò)誤:227 Entering Passive Mode (500 oo

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

問題描述

限時(shí)送ChatGPT賬號..

我在將 Windows 服務(wù)連接到 FTP 站點(diǎn)時(shí)遇到問題.

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

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

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).

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

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:

遠(yuǎn)程服務(wù)器返回錯(cuò)誤: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();

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

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:

遠(yuǎn)程服務(wù)器返回錯(cuò)誤:(500) 語法錯(cuò)誤,命令無法識別.

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

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

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.

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

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.

然后我運(yùn)行了 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:

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

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

所以正如您在上面的失敗連接中看到的那樣,我可以很好地登錄服務(wù)器.然后無論出于何種原因發(fā)送了一個(gè)額外的請求,即TYPE I",它提示切換到二進(jìn)制模式"的響應(yīng).在下面,我得到以下內(nè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:無數(shù)據(jù)

500 oops: vsf_sysutil_recv_peek: no data

另外我也把Passive屬性設(shè)置為false后又跑了一次,這就是我當(dāng)時(shí)得到的:

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 問題并將該屬性設(shè)置為 false,那會解決我的問題嗎?

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

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

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

推薦答案

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

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 返回的細(xì)節(jié)中:

The clue was in the detail of the 227 return:

10051 – 嘗試對無法訪問的網(wǎng)絡(luò)進(jìn)行套接字操作

10051 – A socket operation was attempted to an unreachable network

此外,對于通過 Google 等訪問此內(nèi)容的任何人,遠(yuǎn)程服務(wù)器被配置為僅允許被動連接,這就是我收到 500 語法錯(cuò)誤的原因.研究下載文件時(shí)的 Wire 捕獲發(fā)現(xiàn),如果選擇 Active 但失敗,F(xiàn)ilezilla 實(shí)際上會自動恢復(fù)到 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.

我原來帖子中的代碼現(xiàn)在可以正常工作了.

The code in my original post works fine now.

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

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

相關(guān)文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進(jìn)行身份驗(yàn)證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權(quán)不起作用)
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(如何獲取守護(hù)進(jìn)程或服務(wù)器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發(fā)技
.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(異步調(diào)用時(shí) Azure KeyVault Active Directory AcquireTokenAsync 超時(shí))
主站蜘蛛池模板: 欧美一区二区三区四区五区无卡码 | 亚洲精品乱码久久久久久黑人 | 日日干天天操 | 午夜精品久久久久久久星辰影院 | 欧美性网站 | 日韩欧美视频 | 国产欧美日韩一区二区三区在线 | 国产精品一区二区久久久久 | 国产精品久久久爽爽爽麻豆色哟哟 | 国产在线永久免费 | 久热精品在线观看视频 | 久久精彩视频 | 精品一区在线 | 大香网伊人| 国产在线观看一区二区 | 成人一区二区视频 | 日韩在线免费视频 | 手机日韩 | 亚洲 欧美 综合 | 久久国产精品一区二区三区 | 365夜爽爽欧美性午夜免费视频 | 亚洲国产中文字幕 | 懂色中文一区二区三区在线视频 | 欧美不卡视频一区发布 | 龙珠z国语版在线观看 | 午夜av电影 | 国产精品久久久久久久久免费樱桃 | 欧美爱爱视频网站 | 91 中文字幕 | 美女爽到呻吟久久久久 | 91在线观看 | 欧美2区 | 四虎永久免费在线 | 午夜精品一区 | 中国av在线免费观看 | 国产日韩欧美在线观看 | 久久免费视频观看 | 久久久久久久一区二区三区 | 国产高清免费 | 欧美aaaaaa| 国产黄色大片 |