本文介绍了从ftp服务器获取文件信息c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-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
我需要在单个请求中获取文件名和文件大小。请告诉我该怎么做?我只得到文件名。
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 [ ^ ]。
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#
发布评论