//
// 在指定应用程序域中执行代码
//
//
//
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));
};
Www^Chinaz^com
// 在指定程序域中执行代码
domaintest.DoCallBack(callback); Chinaz_com
Console.Read();
}
}
}
中.国站长站
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


