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

FTPClient如何刪除目錄?

How can FTPClient delete a directory?(FTPClient如何刪除目錄?)
本文介紹了FTPClient如何刪除目錄?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我想刪除 FTP 中的一個文件夾.

I want to delete a folder in FTP.

FTPClient對象可以刪除嗎?

推薦答案

FtpWebRequest 提供刪除操作.這是實現(xiàn)這一目標的一段代碼:

FtpWebRequest provides the Delete action. Here is a piece of code to achieve that :

               FtpWebRequest reqFTP = FtpWebRequest.Create(uri);
                // Credentials and login handling...

                reqFTP.Method = WebRequestMethods.Ftp.DeleteFile;

                string result = string.Empty;
                FtpWebResponse response = reqFTP.GetResponse();
                long size = response.ContentLength;
                Stream datastream = response.GetResponseStream();
                StreamReader sr = new StreamReader(datastream);
                result = sr.ReadToEnd();
                sr.Close();
                datastream.Close();
                response.Close();

它應該適用于文件和目錄.確實,請檢查您是否擁有正確的權限.

It should work on files and directories. Indeed, please check that you have the right permissions.

此外,當文件夾不為空時,您無法刪除它們.您必須遞歸遍歷它們才能刪除內(nèi)容.

Also, you could not delete folders while they are not empty. You must traverse them recursively to delete content before.

由于權限問題引發(fā)的異常并不總是很清楚...

The exceptions thrown due to right permissions problems are not always very clear...

這篇關于FTPClient如何刪除目錄?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(liá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 令牌授權不起作用)
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屋-程序員軟件開發(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)用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 日韩中文字幕2019 | 一级片在线播放 | 新超碰97 | 我想看国产一级毛片 | 黄色国产区 | 91免费小视频 | 一区二区三区四区电影 | av一区二区三区 | 免费在线观看一区二区 | 亚洲日韩中文字幕 | 欧美久久久久久久久 | 成人小视频在线观看 | 国产免费xxx | 日日爱夜夜操 | 99精品视频免费观看 | 日日操夜夜操天天操 | 亚洲视频在线看 | 毛片黄片 | 国产精品毛片av | 亚洲第一福利视频 | 日韩一区二区免费视频 | 久久久99精品免费观看 | 国产精品一区二区久久精品爱微奶 | 成人精品在线观看 | 日本精品视频在线观看 | 成人在线一区二区三区 | 亚洲成人自拍 | 国产91在线 | 亚洲 | 麻豆一区 | av毛片| 久久九七 | 99精品久久久久久中文字幕 | 亚洲狠狠 | 国产精品免费视频一区 | 日韩欧美网 | 一级大黄色片 | 午夜在线小视频 | 成人一区二区在线 | 久久久久久久久国产精品 | 欧美天堂| 久久99久久99精品免视看婷婷 |