2.我们可以通过Assembly 类来对 类AssemblyInfo.cs 进行 操作;
3.AssemblyInfo.cs 在文件夹properties 下,每个程序都有,它记录着程序集的许多相关信息;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过下列属性集
// 控制。更改这些属性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("RongTongProtocol")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("产品名称")]
[assembly: AssemblyCopyright("版权所有 (C) 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
............
4.我们在主程序中调用它:
'程序集文件路径
Dim pPath As String = AppDomain.CurrentDomain.BaseDirectory + "\Plugins"
'取得该文件夹下所有文件路径
Dim strFunctionFiles As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = _
My.Computer.FileSystem.GetFiles(pPath)
'遍历所有文件(数据集)
For Each pth As String In strFunctionFiles
'取得文件
Dim pthInfo As FileInfo = My.Computer.FileSystem.GetFileInfo(pth)
'取得文件名
'Dim pathName As String = Path.GetFileName(pth) '取得数据集的产品名称
'加载程序集相关信息
Dim myAsembly As System.Reflection.Assembly = System.Reflection.Assembly.LoadFrom(pth)
'取得产品信息
Dim myAttribute As System.Attribute _
= System.Reflection.AssemblyProductAttribute.GetCustomAttribute(myAsembly, GetType(System.Reflection.AssemblyProductAttribute), True)
'system.Attribute.
'取得产品名称
Dim strNameSpace As String = myProductAttribute.Product
Next
5.OK....数据取出来了...同理可以读取其它信息...甚至自定义信息;我也没尝试过,有兴趣的朋友可尝试尝试.最好给予回复互相学习.呵呵....上面代码相对简单我就不写成C#了.如有需要可留言.