超级入门级:) 哈哈~ 留个纪念。
//
// 在指定应用程序域中执行代码
//
//
//
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();
}
}
}
新闻热点
疑难解答