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

如何在 C# 中發(fā)送任意 FTP 命令

How to send arbitrary FTP commands in C#(如何在 C# 中發(fā)送任意 FTP 命令)
本文介紹了如何在 C# 中發(fā)送任意 FTP 命令的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我已經(jīng)使用 C# 中的 FtpWebRequest 類實現(xiàn)了上傳、下載、刪除等功能.這是相當直接的.

I have implemented the ability to upload, download, delete, etc. using the FtpWebRequest class in C#. That is fairly straight forward.

我現(xiàn)在需要做的是支持發(fā)送任意FTP命令如

What I need to do now is support sending arbitrary FTP commands such as

quote SITE LRECL=132 RECFM=FB
or 
quote SYST

這是直接來自我們的 app.config 的示例配置:

Here's an example configuration straight from our app.config:

<!-- The following commands will be executed before any uploads occur -->
<extraCommands>
     <command>quote SITE LRECL=132 RECFM=FB</command>
</extraCommands>

我仍在研究如何使用 FtpWebRequest 來做到這一點.接下來我可能會嘗試 WebClient 類.任何人都可以更快地指出我正確的方向嗎?謝謝!

I'm still researching how to do this using FtpWebRequest. I'll probably try WebClient class next. Anyone can point me in the right direction quicker? Thanks!

更新:我得出了同樣的結(jié)論,從 .NET Framework 3.5 FtpWebRequest 開始,除了 WebRequestMethods.Ftp.*.我將嘗試其他一些帖子推薦的第三方應用程序.謝謝您的幫助!

UPDATE: I've come to that same conclusion, as of .NET Framework 3.5 FtpWebRequest doesn't support anything except what's in WebRequestMethods.Ftp.*. I'll try a third party app recommended by some of the other posts. Thanks for the help!

推薦答案

我不認為用 FtpWebRequest... 指定 FTP 命令的唯一方法是通過 Method 屬性,文檔說明:

I don't think it can be done with FtpWebRequest... The only way to specify a FTP command is through the Method property, and the documentation states :

請注意,WebRequestMethods.Ftp 類中定義的字符串是 Method 屬性唯一受支持的選項.將 Method 屬性設(shè)置為任何其他值將導致 ArgumentException 異常.

Note that the strings defined in the WebRequestMethods.Ftp class are the only supported options for the Method property. Setting the Method property to any other value will result in an ArgumentException exception.

SITE 和 SYST 不在預定義選項中,所以我猜你被卡住了...

SITE and SYST are not among the predefined options, so I guess you're stuck...

不要浪費時間嘗試 WebClient 類,它給你的靈活性比 FtpWebRequest 還要低.

Don't waste time to try the WebClient class, it will give you even less flexibility than FtpWebRequest.

但是,有很多第三方 FTP 實現(xiàn),開源的或商業(yè)的,我很確定其中一些可以處理自定義命令...

However, there are plenty of third-party FTP implementation, open source or commercial, and I'm pretty sure some of them can handle custom commands...

這篇關(guān)于如何在 C# 中發(fā)送任意 FTP 命令的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 進行身份驗證并跨請求保留自定義聲明)
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)不起作用)
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屋-程序員軟件開發(fā)技
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調(diào)用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
Getting access token using email address and app password from oauth2/token(使用電子郵件地址和應用程序密碼從 oauth2/token 獲取訪問令牌)
New Azure AD application doesn#39;t work until updated through management portal(新的 Azure AD 應用程序在通過管理門戶更新之前無法運行)
主站蜘蛛池模板: 丁香婷婷在线视频 | 久久亚洲二区 | 精品中文在线 | 91一区二区 | 不卡一区 | 天天久久 | 中文字幕第一页在线 | 久久国产精品一区二区三区 | 欧美日韩亚 | 精品久久一 | 欧美成年网站 | 久久久综合 | 久久久激情视频 | 日韩精品一 | 久久久女| 日本欧美国产在线 | 久久久久一区二区三区 | 亚洲国产免费 | 婷婷综合久久 | 欧美高清视频一区 | 国产91在线 | 欧美 | 精品国产青草久久久久96 | 天天干天天干 | 欧美一区二区免费 | 久久久久成人精品 | 一区二区在线看 | 一区二区日韩 | 国产亚洲精品一区二区三区 | 日韩高清av | 自拍偷拍视频网 | 日韩在线小视频 | 久久久久久免费精品一区二区三区 | a级毛片毛片免费观看久潮喷 | 精品久久久久久久久久久 | 婷婷一级片| 在线免费观看黄视频 | 国产精品中文字幕一区二区三区 | 免费观看av网站 | 精品日韩一区 | 欧美日韩最新 | www.一区二区三区 |