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

FTPClient如何刪除目錄?

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

問(wèn)題描述

限時(shí)送ChatGPT賬號(hào)..

我想刪除 FTP 中的一個(gè)文件夾.

I want to delete a folder in FTP.

FTPClient對(duì)象可以刪除嗎?

推薦答案

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

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();

它應(yīng)該適用于文件和目錄.確實(shí),請(qǐng)檢查您是否擁有正確的權(quán)限.

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

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

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

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

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

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

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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)證并跨請(qǐng)求保留自定義聲明)
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 訪問(wèn)令牌和刷新令牌) - IT屋-程序員軟件開發(fā)技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問(wèn)令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調(diào)用時(shí) Azure KeyVault Active Directory AcquireTokenAsync 超時(shí))
主站蜘蛛池模板: 日韩视频一区二区 | 久久国产精品久久久久久 | 国产女人与拘做受免费视频 | h视频在线免费 | 国产传媒毛片精品视频第一次 | 日韩三区在线观看 | 一起操网站| 天堂一区 | 国产成人精品高清久久 | 久久99精品久久久久久国产越南 | 亚洲性视频 | 国产精品视频久久久 | 日韩一区二区在线观看 | 国产网站在线免费观看 | 亚洲欧美另类在线观看 | 久久国产精品视频观看 | 国产丝袜人妖cd露出 | 三级国产三级在线 | 日韩中文字幕在线观看视频 | 99reav| www.日本国产 | 国产高清视频在线观看 | 激情免费视频 | 91免费在线| 国产成人精品一区二区三区在线 | 日本一区二区三区视频在线 | 青青操91| 国产精品久久 | 日韩精品一区二区三区中文在线 | www国产成人免费观看视频,深夜成人网 | 久草免费在线视频 | 91精品在线播放 | 国产成人精品在线播放 | 久久亚洲精品久久国产一区二区 | 精品国产视频 | 特黄特色大片免费视频观看 | 欧美精品一区二区三区一线天视频 | 一级中国毛片 | 免费在线观看一区二区三区 | 国产精品久久久久久久久久久久午夜片 | 国产一区二区视频免费在线观看 |