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

在 C# 中從 FTP 中刪除文件

Deleting file from FTP in C#(在 C# 中從 FTP 中刪除文件)
本文介紹了在 C# 中從 FTP 中刪除文件的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

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

我的程序可以使用以下代碼將文件上傳到 FTP 服務(wù)器:

My program can upload files into an FTP server using this code:

WebClient client = new WebClient();
client.Credentials = new System.Net.NetworkCredential(ftpUsername, ftpPassword);
client.BaseAddress = ftpServer;
client.UploadFile(fileToUpload, WebRequestMethods.Ftp.UploadFile, fileName);

現(xiàn)在我需要?jiǎng)h除一些文件,但我做不到.我應(yīng)該用什么來(lái)代替

Right now I need to delete some files and I can't do that right. What should I use instead of

client.UploadFile(fileToUpload, WebRequestMethods.Ftp.UploadFile, fileName);

推薦答案

您需要使用 FtpWebRequest 類來(lái)做那個(gè),我想.

You'll need to use the FtpWebRequest class to do that one, I think.

FtpWebRequest request = (FtpWebRequest)WebRequest.Create(serverUri);

//If you need to use network credentials
request.Credentials = new NetworkCredential(ftpUsername, ftpPassword); 
//additionally, if you want to use the current user's network credentials, just use:
//System.Net.CredentialCache.DefaultNetworkCredentials

request.Method = WebRequestMethods.Ftp.DeleteFile;
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Console.WriteLine("Delete status: {0}", response.StatusDescription);  
response.Close();

這篇關(guān)于在 C# 中從 FTP 中刪除文件的文章就介紹到這了,希望我們推薦的答案對(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屋-程序員軟件開(kāi)發(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í))
主站蜘蛛池模板: 在线免费av观看 | 久久丁香 | 免费看爱爱视频 | 欧美综合视频在线 | 性福视频在线观看 | 五月婷婷激情 | 激情毛片 | 欧美久久精品一级c片 | 午夜免费电影院 | 一区二区视频 | 久久成人av电影 | 亚洲激情视频在线 | 亚洲一区二区综合 | 毛片毛片毛片毛片 | 久久免费精品视频 | 久色网| 国产精品一区二区av | 亚洲天堂一区二区 | 夫妻午夜影院 | 免费h在线 | 亚洲精品视频一区二区三区 | 古装三级在线播放 | 99爱在线视频 | 日本成人一区二区 | 欧美一区二区三区在线免费观看 | 青青草华人在线视频 | 精品区一区二区 | 欧美1区 | 色妞av | 国产精品久久久久影院色老大 | 先锋av资源在线 | 欧美激情视频一区二区三区在线播放 | 国产精品1区2区 | 日韩电影中文字幕在线观看 | 国产做爰 | 国产草草视频 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 仙人掌旅馆在线观看 | 91中文在线观看 | 欧美在线色视频 | 日韩精品在线看 |