当前位置:首页 » 文件管理 » ftp多线程下载

ftp多线程下载

发布时间: 2022-01-08 00:36:07

㈠ 2003搭建多线程ftp下载服务器

ADSL是一种非对称的DSL技术,所谓非对称是指用户线的上行速率与下行速率不同,上行速率低,下行速率高,ADSL 在一对铜线上支持上行速率512Kbps~1Mbps,下行速率1Mbps~8Mbps,有效传输距离在3~5公里范围以内。
你要提高外网下载速度,只能更换成小区宽带,而后使用动态域名的方式。

㈡ C#多线程ftp下载的实现(java也可,关键是思路)

参考答案:读书之法,在循序而渐进,熟读而精思。——朱熹

㈢ delphi FTP 多线程下载 (能支持断点更好)

看不懂

㈣ windows环境下c语言支持ftp和http多线程下载的客户端

下面的程序,编译之后,你可以运行很多个实例,目前我将文件写在了D:\1.txt,每个程序写1000行数据,这些值你可以自己更改(比如 写在C:,每个程序写10000行等),等程序都写完后,你可以去文件中查看写文件的结果。补充一下,我是在VC6.0环境中写的,所以windows.h,如果你不是在这个环境中的话,可能需要修改一些定义,比如DWORD等。其他的API都是windows平台提供的API;
#include <stdio.h>
#include "windows.h"
int main()
{
//获取进程ID,因为你希望是多个进程运行同时写一个文件,所以,我们打印出进程ID
DWORD dwProcessID = GetCurrentProcessId();

//初始化我们要写入文件中的内容,及该内容长度;
char szContent[100] = ;
sprintf(szContent,"process[%u] write file\r\n",dwProcessID);
DWORD dwContentLen = strlen(szContent);

//创建互斥量,这样可以进行进程间的互斥,当然用这个也可以做线程间的互斥
HANDLE hMutex = CreateMutex(NULL,FALSE,"MyFileMutex");
if (NULL == hMutex)
{
printf("[%u]Create/Open Mutex error!\r\n",dwProcessID);
return 1;
}

//创建或打开文件
HANDLE hFile = CreateFile("D:\\1.txt",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_WRITE | FILE_SHARE_READ,NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_ARCHIVE,
NULL);
if (INVALID_HANDLE_VALUE == hFile)
{
printf("[%u]Creat/Open file error!\r\n",dwProcessID);
return 1;
}

//循环写入文件
for(int i = 0; i < 1000 ; i++)
{
//等待临界资源,即锁定文件
WaitForSingleObject(hMutex,INFINITE);
printf("Process[%u] Get the signal\r\n",dwProcessID);
DWORD len = 0;

//因为是共享写文件,即多个程序写一个文件,所以一定要将文件指针偏移到尾部
SetFilePointer(hFile,0,NULL,FILE_END);

//写入文件
BOOL rnt = WriteFile(hFile,szContent,dwContentLen,&len,NULL);
if (rnt == FALSE)
{
printf("Process[%u] Fail to write file\r\n",dwProcessID);
}

//释放互斥量,解除锁定
ReleaseMutex(hMutex);

//加个Sleep便于我们中间观察结果
Sleep(30);
}
CloseHandle(hMutex);
CloseHandle(hFile);
return 0;
}

应你要求,我把AIP中的宏定义解释如下:
HANDLE hFile = CreateFile("D:\\1.txt",
GENERIC_READ | GENERIC_WRITE,//表示程序对该文件有读和写的权限
FILE_SHARE_WRITE | FILE_SHARE_READ,//表示可以多个程序共享读和写的权限
NULL,
OPEN_ALWAYS,//表示打开该文件,如果该文件不存在,则创建该文件
FILE_ATTRIBUTE_ARCHIVE,//文件的属性为存档
NULL);

WaitForSingleObject(hMutex,INFINITE);
//INFINITE表示永远等待,直到hMutex有信号为止

SetFilePointer(hFile,0,NULL,FILE_END);
//FILE_END表示从文件尾部开始偏移;实际此举就是将文件指针偏移到文件尾部;
另外,虚机团上产品团购,超级便宜

㈤ 如何设置多线程FTP下载

FlashfXP只能单线程下载,可以先用FlashfXP登录FTP站点,选中你要下载的文件,右击鼠标,在出现的菜单上选择:“复制URL(Ctrl+U)”,FlashfXP会提示:“是否复制用户名及密码?”,选择“是”,然后打开迅雷,点“新建(Ctrl+N)”下载任务,在出现的界面上边:“网址(URL)”里面(Ctrl+V)填上刚刚粘贴的信息,这样迅雷就可以从你的FTP站点多线程下载文件了,而且你可以同时下载不同的文件,也是多线程的。当然,万一你的FTP站点是限制单线程下载的话,为了充分利用带宽,就只好同时下载其他文件来提高效率。万一你的FTP站点是限制每个IP只能单线程下载一份文件,这个办法可能就无能为力了。希望能帮到你,呵呵~~

㈥ C++程序中如何实现ftp多线程下载

本人不才,下面这个是从网络上转来的.不知可有帮助.

这是codeproject的关于ftp的实现,你可以去down源代码
Introction

StuffFTP is a free for life FTP client. This FTP client will allow you to connect to FTP servers and upload and download files.
Motivation

Why did I create and continue to support StuffFTP? First it is a learning experience, and since I just got laid off from my company, I decided to use some of the tools they have provided, its legal as I technically bought them and they do not have other programmers following in my footstep nor do they plan on hiring any, to create something for the community. I also used another FTP program that was freeware for a while and then became pay to use software with little to no notice. That irked me and a friend suggested I create my own FTP client. So I am.
Progress

This is currently a work in progress and I would be the first to say there is a lot of work to do. Since I am laid off, I have lots of time on my hands. And this is an excellent chance for me to learn some of the concepts of C++ that I wanted to, but never had the chance while I was working. I was hoping to get a job in San Jose, CA, but decided to hold off and live on saving for a while.
Guarantee

I will support this program as best as I can. I have already setup a website and forum for it, here. I use the forum because I have trouble responding to email especially when I get a whole bunch of SPAM everyday. There is no adware or spyware in the program, and I guarantee that it will be free for the life of the program.

Some people have already asked why I don't open source the project. The main reason is I do not know if I can. StuffFTP uses some proprietary third party libraries. I do not know if I can post the source code or header files to those libraries. So everyone will have to wait until I can get rid of those libraries or hear back from the companies concerning my question about releasing header and associated help files.
Tools

* MS Windows XP Professional
* MS Visual Studio .NET C++/MFC
* Clickteam Install Maker
* Clickteam Patch Maker
* Betaone.net forum members
* CXListCtrl by Hans Dietrich

3rd Party Libraries

The application uses Catalyst Socket Tools Library Edition and Professional UI GUI library. So far the support has been fair with Prof-UI and outstanding with Catalyst. The Catalyst tool is for the actual FTP connection and, as the name suggests, Prof-UI is being used for the GUI.
Updates

You can find the latest updates here and you can also find my latest ramblings, blogs, and support here. This is where you can find out all the latest versions and information.
How to contribute

Money! Just kidding you can contribute by downloading, using, and giving feedback on the program. That way I can determine which path to take with the application and which features to prioritize or not. Graphics is also where I need lots of help. I am left brained and can not draw a good stick figure to save my life. If you can help with graphics or anything else, please let me know. Also talk to me, I am bored. I have no job at the moment so I can use the company.
Features

* Able to upload/download from server/computer
* Connect to FTP sites using login
* Connect using other ports besides 21
* Delete, rename, and CHMOD a file

History

* 12/10/2003 - Version 0.11a
* 12/07/2003 - Version 0.10a

㈦ 在bat脚本中如何实现ftp多任务同时下载,或者多线程下载

@echo off
setlocal enabledelayedexpansion
set ftpsvr=192.168.1.100
set downlist=a.rar b.rar c.rar
for %%i in (%d%) do (
set fn=ftp_%%i.txt
echo open %ftpsvr>!fn!
echo username>>!fn!
echo password>>!fn!
echo bin>>!fn!
echo get %%i>>!fn!
echo bye>>!fn!
start "ftp -s:!fn!")
del ftp_*.txt

㈧ ftp上的文件夹下载有没有多线程下载的,我家网络50m带宽,下载速度才500k,如果用两个ftp软

迅雷不就是吗

㈨ java如何实现基于http和ftp多线程下载工具...

访问网络资源就要去了解你要访问的网络资源所使用的协议。一般来说我们所使用的协议都是公开式的协议,比如http协议,它在数据的前面部分先设置一些信息来说明它所发送的数据的大小,文件类型等等。而多线程的实现原理就是先从http协议中获取要下载的资源的资源大小,然后再分多个线程从不同的起点跟终点来分段下载资源。ftp资源的道理也是一样。当然我并不是网络方面的专家,对网络我也不懂。以后只是我个人见解。
以下是给你找的一个java实现的http多线程下载。你看看吧
http://shazi.javaeye.com/blog/99132

热点内容
android资源打包jar 发布:2024-07-02 02:39:29 浏览:208
长生诀源码 发布:2024-07-02 02:30:29 浏览:290
sql在某一天 发布:2024-07-02 02:16:23 浏览:965
刹车编程 发布:2024-07-02 02:02:56 浏览:331
访问的仿组词 发布:2024-07-02 02:02:54 浏览:79
excel以文本形式存储数字 发布:2024-07-02 01:51:01 浏览:312
云服务器并联 发布:2024-07-02 01:40:15 浏览:741
如何选工业服务器 发布:2024-07-02 01:37:34 浏览:213
二进制最小的存储单位字节 发布:2024-07-02 01:37:31 浏览:862
android请求json数据 发布:2024-07-02 01:30:04 浏览:879