有没有什么办法,以确定其中的AppDomain是创建一个对象或对象句柄实例?
Is there any way to determine in which AppDomain was an object or ObjectHandle instance created?
从另一个应用程序域中的对象是透明代理。有可能得到真正的代理服务器和访问私有字段包含域ID:
An object from another app domain is a transparent proxy. It is possible to get the real proxy and access the private field that contains the domain id:
public static int GetObjectAppDomain(object proxy)
{
RealProxy rp = RemotingServices.GetRealProxy(proxy);
int id = (int)rp.GetType().GetField("_domainID", BindingFlags.Instance|BindingFlags.NonPublic).GetValue(rp);
return id;
}
如果不知道可能的应用程序域的列表,这里 是一种方法,让所有应用程序域的列表中。
If the list of possible app domains isn't known, here is a way to get the list of all app domains.
上一篇:如何停止在Android服务只在有我的应用程序的运行没有其他的活动?我的、其他的、只在、应用程序
下一篇:如何使用PhoneGap的打开Twitter和Facebook应用程序?如何使用、应用程序、Twitter、PhoneGap