㈠ qt中连接到ftp服务器上后怎么获取服务下所有的文件名
操作方法如下:
@echo off
set h=192.168.1.100
set u=ftpuser
set p=12345678
echo open %h%>ftp.txt
echo %u%>>ftp.txt
echo %p%>>ftp.txt
echo dir>>ftp.txt
echo bye>>ftp.txt
ftp -s:ftp.txt>ftpdir.txt
echo open %h%>ftp.txt
echo %u%>>ftp.txt
echo %p%>>ftp.txt
for /f "tokens=4" %%i in ('findstr "<DIR>" ftpdir.txt') do (
echo cd %%~i>>ftp.txt
echo dir>>ftp.txt
echo cd ..>>ftp.txt)
echo bye>>ftp.txt
ftp -s:ftp.txt>ftpfile.txt
notepad ftpfile.txt
㈡ 用JAVA获取FTP文件列表
学习一下ftp协议,然后用socket来模拟就可以了
㈢ 易语言如何获取FTP服务器文件列表,并显示到列表框,有知道的回答下,问了全世界都没人知道
文件号 = 写到文件 (取运行目录 () + “自己取名字”, HTTP读文件 (“自己的FTP列表”))
循环判断首 ()
列表框1.加入项目 (读入一行 (文件号), )
循环判断尾 (是否在文件尾 (文件号, ) = 假)
㈣ windowsftp如何获取文件夹下所有的文件
可以通过命令窗口来打开所有的文件。具体步骤如下:
点击win+R后输入cmd打开dos命令窗口。
打开需获取文件名的位置。
获取名称,命令格式:dir/b文件目标盘符文件夹位置(可省略)目标名称.目标后缀。
获取文件大小及文件名、修改时间(文件大小需处理)。
Microsoft Surface是一个由微软所开发的第一款平面电脑,结合硬件与软件的新技术,用家可以直接用手或声音对屏幕作出指令,触摸和其他外在物理物来和电脑进行交互,毋须再依赖会令手部劳损的鼠标与键盘。
㈤ 如何从ftp上读取超过100m的数据
1、FTP客户端准确的连接服务器,IP,端口,账号,密码。2、选好本地想要保存的目的位置。3、FTP服务器允许下载。。。4、只要选择文件,鼠标选中直接拖放到本地硬盘文件夹内即可。
㈥ 如何用FTP获取文件
如果是通过命令行交互式的:
1.
ftp
server_ip
2.
提示输入用户名:输入你的ftp用户名
3.
提示输入密码:输入ftp用户的密码
4.
切换为bin模式:b或者bin命令
5.
用get命令接完整文件名:get
your_file
6.
用wget+通配符模式获取多个文件:wget
*.txt
7.
退出ftp:bye
㈦ C# 获取Ftp某个目录下的所有文件(不要文件夹)
我在之前做过一个FTP的客户端工具。
drw 文件夹
-rw 文件(有扩展名或无扩展名)
我是根据服务端返回的报文进行分析获取的列表。
给你一些代码片段:
/// <summary>
/// 获取指定目录下的文件和文件夹。
/// </summary>
/// <param name="path">要获取的目录</param>
/// <param name="WRMethods">要发送到FTP服务器的密令。</param>
/// <returns></returns>
public string[] GetFileList(string path, string WRMethods)//从ftp服务器上获得文件列表
{
WebResponse response;
string[] downloadFiles;
int conut = 4;
StringBuilder result = new StringBuilder();
Connect(path);
if (FTPVariable.IsUseProxy_ftp)
{
reqFTP.Proxy = FtpProxy.GetFtpSelectProxy(FTPVariable.FtpCommand_transferProxyName);
}
reqFTP.ReadWriteTimeout = 12000;
//如果不应销毁到服务器的连接,则为 true;否则为 false。默认值为 true。
//
reqFTP.Method = WRMethods;
try
{
response = (FtpWebResponse)reqFTP.GetResponse();
goto Ftp_lbl_03;
}
catch (WebException webex)
{
GetReply(webex.Message);
if (ReplyCode == 530)// 未登录。
{
goto Ftp_lbl_04;
}
else if (ReplyCode == 550)
{
goto Ftp_lbl_04;
}
else
{
FtpManage.SetLog("获取列表超时,等候1秒后重试!");
goto Ftp_lbl_01;
}
}
Ftp_lbl_01:
try
{
FtpManage.SetLog("正在连接服务器 " + FtpRemoteHost);
response = GetRequest(path, WRMethods);
}
catch (WebException)
{
FtpManage.SetLog("获取列表超时,等候1秒后重试!");
downloadFiles = null;
System.Threading.Thread.Sleep(1000);
if (conut == 0)
{
goto Ftp_lbl_02;
}
conut--;
goto Ftp_lbl_01;
}
catch (Exception ex)
{
MSG.Show(ex.Message, Global.GetRS["msgTilteError"], MessageBoxButton.OK, MsgIco.Error);
FtpManage.SetLog("命令执行失败,原因:" + ex.Message);
downloadFiles = null;
return downloadFiles;
}
Ftp_lbl_03:
StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default);//中文文件名
string line = reader.ReadLine();
while (line != null)
{
result.Append(line);
result.Append("\n");
line = reader.ReadLine();
}
if (result.Length == 0)
{
return null;
}
// to remove the trailing '\n'
result.Remove(result.ToString().LastIndexOf('\n'), 1);
reader.Close();
response.Close();
FtpManage.SetLog("命令已成功执行");
return result.ToString().Split('\n');
Ftp_lbl_04:
FtpManage.SetLog(ReplyInfo);
return null;
Ftp_lbl_02:
FtpManage.SetLog("550 获取列表失败,无法连接远程服务器!");
FtpManage.ftpmanage.IsRefurbish = true;
return null;
}
/// <summary>
/// 获取指定目录下的文件和文件夹。
/// </summary>
/// <param name="path">要获取的目录</param>
/// <returns></returns>
public string[] GetFileList(string path)//从ftp服务器上获得文件列表
{
return GetFileList(FTPVariable.FtpURLhead + FtpRemoteHost + "/" + path, WebRequestMethods.Ftp.ListDirectory);
}
/// <summary>
/// 获取指定目录下的文件和文件夹。
/// </summary>
/// <returns></returns>
public string[] GetFileList()//从ftp服务器上获得文件列表
{
return GetFileList(FTPVariable.FtpURLhead + FtpRemoteHost + "/", WebRequestMethods.Ftp.ListDirectory);
}
/// <summary>
/// 获取目录和文件名,返回目录表。
/// </summary>
/// <param name="path">要获取的目录</param>
/// <returns></returns>
public string[] GetCatalog_FileList(string path)
{
string[] fountainhead = GetFileList(FTPVariable.FtpURLhead + FtpRemoteHost + "/" + path, WebRequestMethods.Ftp.ListDirectoryDetails);
string[] Catalog = null;
if (fountainhead == null)
{
return null;
}
Catalog = new string[fountainhead.Length];
for (int i = 3; i < fountainhead.Length; i++)
{
Catalog[i - 3] += fountainhead[i].Substring(55, fountainhead[i].Length - 55) + "&";//FileName
Catalog[i - 3] += fountainhead[i].Substring(30, 12) + "&";//FileSize
Catalog[i - 3] += fountainhead[i].Substring(42, 13) + "&";//AmendDate
Catalog[i - 3] += fountainhead[i].Substring(0, 3) + "&";
}
return Catalog;
}
㈧ java如何获取ftp制定目录下所有文件集合(包括文件名称)只要一个方法。
/**
* 取得相对于当前连接目录的某个目录下所有文件列表
*
* @param path
* @return
*/
public List getFileList(String path){
List list = new ArrayList();
DataInputStream dis;
try {
dis = new DataInputStream(ftpClient.nameList(this.path + path));
String filename = "";
while((filename = dis.readLine()) != null){
list.add(filename);
}
} catch (IOException e) {
e.printStackTrace();
}
return list;
}
我从这里拷来的 你不清楚看看里面 http://hi..com/yuanhotel/item/000b6334894d11f42784f4da
满意就采纳 谢谢
㈨ C++ 怎么获取FTP上所有的文件夹还有所有文件
通过CFtpFileFind递归进行查询,如果没有文件,会返回false,就不用进行再查找了。如果有文件或文件夹,通过getnext进行遍历查看就行