从ftp服务器获取文件信息c#

编程入门 行业动态 更新时间:2024-10-24 06:29:23
本文介绍了从ftp服务器获取文件信息c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要在单个请求中获取文件名和文件大小。请告诉我该怎么做?我只得到文件名。

Hi, I need to get file name and file size in single request.Pls tell me how to do that? i am getting only file name.

推荐答案

你可以使用类 System.Net.FtpWebRequest : msdn.microsoft/en-us/ library / system.ftpwebrequest.aspx [ ^ ]。 查看您可以发出的所有请求方法: msdn.microsoft/en-us/library/system.webrequestmethods.ftp.aspx [ ^ ]。
-SA
You can use the class System.Net.FtpWebRequest: msdn.microsoft/en-us/library/system.ftpwebrequest.aspx[^]. Look at all the request methods you can issue: msdn.microsoft/en-us/library/system.webrequestmethods.ftp.aspx[^].
—SA

WebRequestMethods.Ftp.GetFileSize失败,错误550:SIZE不允许进入ASCII模式。 显然没有让FtpWebRequest在SIZE之前发送TYPE I命令的方法。 social.msdn.microsoft/Forums/en-US/0c38814e-d8e3-49f3-8818-b5306cc100ce / ftpwebrequestusebinary-does-not-work [ ^ ] WebRequestMethods.Ftp.GetFileSize fails with error 550: SIZE not allowed in ASCII mode. Apparently there is no way to make the FtpWebRequest to send the TYPE I command before the SIZE. social.msdn.microsoft/Forums/en-US/0c38814e-d8e3-49f3-8818-b5306cc100ce/ftpwebrequestusebinary-does-not-work[^]

更多推荐

从ftp服务器获取文件信息c#

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

发布评论

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

>www.elefans.com

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