摘要:
委托可以把一个方法作为参数代入另一个方法。委托可以理解为指向一个函数的指针。简单案例:文本框中只能输入数字,否则提示错误在项目中添加Web窗体和Web用户控件。Web用户控件前台样式:后台代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace 委托的简单应用{ public partial class WebUserControl1 : System.Web.. 阅读全文
摘要:
多线程的目的是是提高速度,而是同时可以执行多个功能,我觉得速度相对会变慢一些,如下小案例:输出数字与字符串,用控制台应用程序实验:单线程:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;using System.Threading;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { //单线程 ... 阅读全文
摘要:
界面非常简单,有一个下载按钮,一个名为资源库的按钮,还有一个backgroundWorker1控件(ps:目的当点击下载按钮的时候不影响点击资源库按钮,意为多线程),backgroundWorker1的DoWork事件中的代码:for (int i = 30320; i < 30340; i++) { try { WebClient client = new WebClient(); client.DownloadFile(@"http://job.cnblogs.com/offer/" + i + "/", @"D:\... 阅读全文