超級入門級:) 哈哈~ 留個紀念。
//
// 在指定應用程序域中執行代碼
//
//
//
using System;
using System.Collections.Generic;
using System.Text;
namespace DomainTest
{
class PRogram
{
private static string strKey = "Key1";
static void Main(string[] args)
{
AppDomain domaintest = AppDomain.CreateDomain("Domaintest");
string strVal = "Value1";
domaintest.SetData(strKey, strVal);
// 跨程序域調用委托
CrossAppDomainDelegate callback = delegate
{
// 取得當前程序域
AppDomain domain = AppDomain.CurrentDomain;
Console.WriteLine(string.Format("Value: {0} In {1}", domain.GetData(strKey), domain.FriendlyName));
};
// 在指定程序域中執行代碼
domaintest.DoCallBack(callback);
Console.Read();
}
}
}
http://luoboqingcai.VEVb.com/archive/2006/06/26/435596.html
新聞熱點
疑難解答