解决方案 »
- winform窗口关闭的一个小问题
- 怎么不能新建网站项目了
- 动态生成两级菜单导航,如何连接到不同类型下的页面
- IIS发布网页后 连接主机的数据库 但是我需要的表在sqlserver2000上 但是在IIS上发布后 总是连接在sqlserver2005上去
- 为何VS2003连接SQL2005老是不成功?(在线等待)
- vs2005、sql2005与.net2.0配置问题
- 菜鸟问题
- 不同凡响的乱码问题
- DataGrid绑定数据源之后,访问生成的Column时,能否知道当前Column对应的数据源字段名?请教思归孟子等高手
- 大家帮我看看这个语句错在哪儿?
- 请问怎么实现google map的图片拖动显示功能?
- Form验证单点登录到windows身份验证网站
Type t = Type.GetType(s, true);
Base.TEST b = (Base.TEST)System.Activator.CreateInstance(t);
匿名类
CSharpCodeProvider p = new CSharpCodeProvider();
CompilerParameters param = new CompilerParameters(new string[] { "System.dll" });
string s = "namespace __ns{public class AAA{ public string name{get{return '";}} }}";
CompilerResults rel = p.CompileAssemblyFromSource(param, s);
Type t = rel.CompiledAssembly.GetType("");
object o = t.GetConstructor(System.Type.EmptyTypes).Invoke(null);
MessageBox.Show(t.GetProperty("name").GetValue(o, null).ToString());