文章分类 - C#
摘要:目的:为WEB程序做一套模板系统,每个模板是一个dll,在不影响主程序的情况下,动态加载模板。假设我们有一个类叫TUser,保存了用户的信息,很简单,只有username和email两个字段Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*****************************************************************/user.cs**编译参数csc/t:library/out:bin/us
阅读全文
摘要:在与子线程进行沟通的时候,把自身对象传递过去是个好主意。
阅读全文
摘要:using System;
using System.Threading;
namespace ifan
{
//自定义委托声明
public delegate void childExitDelegate(object sender, ChildExitEventArgs e);
public class TDelegate
{
//自定义的事件,实际上就是上面那个委托类型的实例
public static event childExitDelegate onChildThreadExit;
private static void Main()
{
//订阅事件,就是说,当onChildThreadExit事件发生时调用onChildExitFunction方法
onChildThreadExit += onChildExitFunction;
//产生一个子线程,ParameterizedThreadStart可以带一个object参数,所以2.0之后我都用这个很方便
Thread t =
阅读全文
浙公网安备 33010602011771号