這個問題來自社區提問
using System;
using System
using System
namespace WindowsApplication
/**////
/// gui 類
///
public partial class Form
public Form
InitializeComponent();
}
private void button
//用子線程工作
new System
}
//開始下載
public void StartDownload()
Downloader downloader = new Downloader();
downloader
onDownLoadProgress);
downloader
}
//同步更新ui
void downloader_onDownLoadProgress(long total
if (this
this
new object[]
}
else
this
this
}
}
}
/**////
/// 下載類
///
public class Downloader
//委托
public delegate void dDownloadProgress(long total
//事件
public event dDownloadProgress onDownLoadProgress;
//開始模擬工作
public void Start()
for (int i =
if (onDownLoadProgress != null)
onDownLoadProgress(
System
}
}
}
}
From:http://tw.wingwit.com/Article/program/ASP/201311/21779.html