摘要:
可以自定义要下载的url和要保存的文件名。using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{static void Main(string[] args){//实例化下载工具//要求用户在使用的时候,填入url和fileNameDownloadUtil du = new DownloadUtil("http://blog.si 阅读全文
摘要:
将要下载的url和fileName的传递从构造中转移到DownloadData方法中,给用户以更大的灵活性。using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{static void Main(string[] args){//在构造时可以不填写url和fileName//在下载的时候再填写。DownloadUtil du = new D 阅读全文
摘要:
把信号机隐藏起来,让调用方干净一点。using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{static void Main(string[] args){//实例化下载工具DownloadUtil du = new DownloadUtil();//订阅事件du.ReadCompleted += new ReadCompletedHandl 阅读全文
摘要:
简单封装:using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{static void Main(string[] args){//信号机AutoResetEvent are = new AutoResetEvent(false);//实例化下载工具DownloadUtil du = new DownloadUtil();du.are = 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{//读取完成委托delegate void ReadCompletedHandler();class Program{//添加一个AutoResetEvent//这是一个信号机static AutoResetEvent are = new AutoResetEvent(false);//读取完成事件static e 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{//读取完成委托delegate void ReadCompletedHandler();//读取过程委托delegate void ReadProgressHandler(int x);class Program{//添加一个AutoResetEvent//这是一个信号机static AutoResetEvent 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{//添加一个AutoResetEvent//这是一个信号机static AutoResetEvent are = new AutoResetEvent(false);static void Main(string[] args){//Version8.0//将下载数据放入线程池中。Thr 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{//添加一个AutoResetEvent//这是一个信号机static AutoResetEvent are = new AutoResetEvent(false);static void Main(string[] args){//Version7.0//将下载数据放入一个单独的线程中 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;using System.Threading;namespace prjDownLoad{class Program{static void Main(string[] args){//Version5.0//使用WebRequest和WebResponse配合//创建WebRequest对象WebRequest wr = WebRequest.Create("http://blog.sina 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;namespace prjDownLoad{class Program{static void Main(string[] args){//Version4.0//使用WebRequest和WebResponse配合//创建WebRequest对象WebRequest wr = WebRequest.Create("http://blog.sina.com.cn/dalishuishou&qu 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;namespace prjDownLoad{class Program{static void Main(string[] args){//Version3.0//使用WebClient来下载WebClient wc = new WebClient();//注册当数据下载完成以后触发的事件wc.DownloadDataCompleted += new DownloadDataCompletedEvent 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;namespace prjDownLoad{class Program{static void Main(string[] args){//Version2.0//使用WebClient来下载WebClient wc = new WebClient();//注册当文件下载完成以后触发的事件wc.DownloadFileCompleted += new System.ComponentModel.Asyn 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;namespace prjDownLoad{class Program{static void Main(string[] args){//Version1.0//使用WebClient来下载WebClient wc = new WebClient();//直接使用下载文件的方法,//只需要指定要下载的Url,和保存的文件名就可以了。wc.DownloadFile("http://blog.s 阅读全文
摘要:
转摘自:http://www.cnblogs.com/Along729/archive/2011/03/01/Toolstrip.html暂时还没时间,把代码分离出来,做到通用,所以大家看着自己动手改改代码吧看图:QQ的 美化方法:使用Renderer属性和ToolStripRenderer类来自定义ToolStrip的外观调用方法//作者:阿龙(Along)//QQ号:646494711//QQ群:57218890//网站:http://www.8timer.com//博客:http://www.cnblogs.com/Along729///声明:未经作者许可,任何人不得发布出售该源码,请尊 阅读全文