用第一个就会报"未能从程序集 WindowsApplication1, Version=1.0.859.19452, Culture=neutral, PublicKeyToken=null 中加载类型 System.Windows.Forms.Button。"
你不报错当然就是null了.你可以自己定义一个类型再试一下.
你不报错当然就是null了.你可以自己定义一个类型再试一下.
解决方案 »
- httpwebrequest上传,AllowWriteStreamBuffering属性
- 设定DataGridViewComboBoxColumn值的问题,急急急!
- windows mobile 开发
- C#中选中treeView控件的信息,如何将信息显示在子窗口中?
- 我郁闷了,求教C# winform中读取第一条纪录的方法
- 急,用OleDB连接Oracel数据库怎么保存Blob数据类型的数据。
- 本人是个新手。所有分求一个C#或ASP。NET项目的需求分析文档。脆谢!
- DataGridTextBoxColumn捕捉不了回车键?!
- 请问: 关于虚拟类
- 怎么进行冲突控制?讨论
- 委托问题:那位给写一个例子,有关委托比较运算的例子
- DotNet高手300分有请,System.Net.WebRequest/System.Net.HttpWebRequest以post方式访问servlet
Type.GetType("System.Windows.Forms.Button, System.Windows.Forms");
true加不加都没关系。
未处理的“System.IO.FileNotFoundException”类型的异常出现在 WindowsApplication3.exe 中其他信息:找不到文件或程序集名称“System.Windows.Forms”,或找不到它的一个依赖项。
Type t=typeof(System.Windows.Forms.Button);
...
(1)在VC#中使用typeof:
Type myTypeBindingFlags = typeof(System.Windows.Forms.Button);
(2)第二中方法是:
using System.Reflection;
……
Assembly assembly=null;
assembly = Assembly.LoadFrom("C:\\WINNT\\Microsoft.NET\\Framework\\v1.0.3705\\System.Windows.Forms.dll");
Type tt = assembly.GetType("System.Windows.Forms.Button", true);
希望这些信息对你有帮助。 — 微软全球技术中心 VB支持中心本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。
string aname = "System.Windows.Forms.Button, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
Type t = Type.GetType(aname, true);