活化剂类 [英] Activator Class

查看:98
本文介绍了活化剂类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

尝试使用Activator创建带有参数的对象(远程环境之外).

基本上想创建一个对象,比如说Person,以字符串作为参数.

我找不到如何使用带有参数的Activator的示例(即Activator将使用带有一个字符串作为参数的构造函数).

Hi there

Trying to use Activator to create an object with parameters (outside of a remoting context).

Basically want to create an object - say Person - with a string as a parameter.

I can''t find an example of how to use Activator with a parameter (i.e. Activator will use the constructor with the one string as parameter).

推荐答案

http://msdn.microsoft.com/en-us/library/system.activator.createinstance%28VS.71%29.aspx [
http://msdn.microsoft.com/en-us/library/system.activator.createinstance%28VS.71%29.aspx[^]

Looks like there''s several methods for providing parameters to pass to constructors.


这篇关于活化剂类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆