globeget.java

来自「这是一个由本人编写的基于java编写的实现文件下载的应用程序」· Java 代码 · 共 49 行

JAVA
49
字号
package download;
import java.io.*;
import java.net.*;
import java.util.*;
public class globeGet {
	public static void main(String [] args)
	{
		try{
		String url="http://qsbbs.net/ad/妈妈.wma";
		ArrayList<Downloadsaction> downlist=new ArrayList<Downloadsaction>();
		String url1="http://res.caishow.com/Caix/264/Ring/2007427182249_test.wma";
		
		int threadNum=10;
		File file=new File("F:\\音乐欣赏\\流行音乐\\妈妈.wma");
		
		int threadNum1=10;
		File file1=new File("F:\\音乐欣赏\\音乐\\妈妈.wma");
		Downloadsaction saction=new Downloadsaction();
		saction.setFileName(file);
		saction.setThreadNum(threadNum);
		saction.setURL(url);
		
		Downloadsaction saction1=new Downloadsaction();
		saction1.setFileName(file1);
		saction1.setThreadNum(threadNum1);
		saction1.setURL(url1);
		
		downlist.add(saction);
		downlist.add(saction1);
		MultiDownload down=new MultiDownload();
		long start=System.currentTimeMillis();
		down.downMulitFile(downlist);
		long end=System.currentTimeMillis();
		System.out.println("下载共用的总时间为:"+(end-start));
	
		}catch(Exception e)
		{e.printStackTrace();}
		
	}
	
	
	
	
	
	
	
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?