引用using Microsoft.Office.Interop.Excel;using System.Reflection;//反射命名空间using System.IO; protected void Button1_Click(object sender, EventArgs e) { ...
分类:
其他好文 时间:
2014-07-16 23:18:29
阅读次数:
149
object missing = System.Reflection.Missing.Value; //表示缺i省object SaveFileDialog savedialog = new SaveFileDialog(); savedialog.Filter = "(*.xlsx)|*.xlsx...
分类:
Web程序 时间:
2014-07-16 23:12:04
阅读次数:
236
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Reflection;namespace Data_Helper{ ...
分类:
其他好文 时间:
2014-07-07 23:51:29
阅读次数:
299
有时我们需要判断某个类是否实现了某个接口(Interface),比如在使用反射机制(Reflection)来查找特定类型的时候。简单来说,可以使用Type.IsAssignableFrom方法:typeof(IFoo).IsAssignableFrom(bar.GetType());typeof(I...
分类:
其他好文 时间:
2014-07-07 21:33:29
阅读次数:
139
property是指类向外提供的数据区域。而attribute则是描述对象在编译时或运行时属性的,分为固有型和用户自定义型,其中用户自定义型可以利用Reflection在运行期获取。这两者是有本质区别的。资料上说二者一个是service的属性,而另一个是interface的。第一种好象更准确,摘要如...
分类:
其他好文 时间:
2014-07-07 14:02:36
阅读次数:
275
cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host Write-Hos...
分类:
其他好文 时间:
2014-07-07 12:54:49
阅读次数:
276
cls [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") foreach ($webApplication in Get-SPWebApplication) { Write-Host Write-Hos...
分类:
其他好文 时间:
2014-07-02 23:12:01
阅读次数:
232
#新建随机数对象实例:$Ran = New-Object System.Random$Ran.NextDouble()有时候,要使用的实例的类保存在独立的库文件中,PowerShell默认未加载,就需要先加载库文件,然后再创建实例类:使用 System.Reflection.Assembly类提供的...
分类:
其他好文 时间:
2014-07-02 00:04:04
阅读次数:
860
比如有这样一个泛型:Demo.GenericsSimple我想要通过反射创建一个Demo.GenericsSimple的实例可以通过下面的格式进行创建:System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("命名空间.Use...
分类:
其他好文 时间:
2014-06-27 22:21:47
阅读次数:
275
$title=“title”$message="hello,world"[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")$balloon = New-Object System.Windo...
分类:
其他好文 时间:
2014-06-27 12:54:43
阅读次数:
216