如何使用c#从ftp中删除文件,必须通过代理建立连接

编程入门 行业动态 更新时间:2024-10-25 02:23:19
本文介绍了如何使用c#从ftp中删除文件,必须通过代理建立连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我在通过代理建立连接时遇到问题,如何使用c#从ftp删除文件,必须通过代理建立连接? 我的编码如下,

string fileName = testFile.txt ; FtpWebRequest requestFileDelete =(FtpWebRequest)WebRequest.Create( ftp:// ... .. + fileName); requestFileDelete.Credentials = new NetworkCredential( ...., ...); requestFileDelete.Method = WebRequestMethods.Ftp.DeleteFile; FtpWebResponse responseFileDelete =(FtpWebResponse)requestFileDelete.GetResponse();

但是我收到以下错误: 使用HTTP代理时不支持请求的FTP命令。 请帮帮我

解决方案

简单的C#FTP类 [ ^

Hi All, I have a problem while establishing connection through proxy, How to delete a file from ftp using c# , the connection have to be established through proxy? My coding is as follows,

string fileName = "testFile.txt"; FtpWebRequest requestFileDelete = (FtpWebRequest)WebRequest.Create("ftp://....." + fileName); requestFileDelete.Credentials = new NetworkCredential("....", "..."); requestFileDelete.Method = WebRequestMethods.Ftp.DeleteFile; FtpWebResponse responseFileDelete = (FtpWebResponse)requestFileDelete.GetResponse();

But am getting the following Error: The requested FTP command is not supported when using HTTP proxy. Please Help me

解决方案

Simple C# FTP Class[^]

更多推荐

如何使用c#从ftp中删除文件,必须通过代理建立连接

本文发布于:2023-11-07 22:36:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1567626.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件   ftp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!