Parsing product assembly meta data
ApplicationInfoUtils
00 Remarks
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| RetrieveLinkerTimestamp | 1 | Linker Timestamp |
| CalculateCompileTime | 1 | 计算出模块文件的编译时间.(在编译项目之前应该手动修改vbproj文件中的Deterministic配置项的值为False来允许自动递增版本号的特性) |
| CalculateVersion | 1 | CalculateCompileTime 的逆运算:根据编译时间反推对应的 Version 对象。 Build = 距离 2000-01-01 的天数;MinorRevision = 编译时刻距当日 00:00:00 的秒数 / 2(向下取整)。 |
| VBCore | 1 | 获取对当前运行时环境的描述 |
| CurrentExe | 1 | 获取当前进程的exe文件的程序描述信息,直接使用New申明得到的只是运行时核心模块dll文件的信息 |
| GetCompanyName | 1 | Get the name of the system provider name from the assembly |
| GetProductVersion | 1 | Get System version from the assembly |
| GetProductName | 1 | Get the name of the System from the assembly |
| GetCopyRightsDetail | 1 | Get the copyRights details from the assembly |
| GetProductTitle | 1 | Get the Product tile from the assembly |
| GetProductDescription | 1 | Get the description of the product from the assembly |
| FromAssembly | 1 | |
| FromTypeModule | 1 | |
| GetGuid | 1 | |
| GetTargetFramework | 1 | |
| GetTrademark | 1 | |
| GetInformationalVersion | 1 |
03 Members
Assembly)Linker Timestamp
Assembly)计算出模块文件的编译时间.(在编译项目之前应该手动修改vbproj文件中的Deterministic配置项的值为False来允许自动递增版本号的特性)
Get Compile date and time in application
Set up your Build and MinorRevision numbers to auto-increment, pull out the date created for by using the Version numbers from the version on the class.
- Open
AssemblyInfo.vb. You'll find it under the Properties folder in your solution.
Find the two lines that say "AssemblyVersion" and "AssemblyFileVersion" in them. Change them to:
<assembly AssemblyVersion("1.0.*")>
<assembly AssemblyFileVersion("1.0.*")>
Once you Do this, Visual Studio will automatically increment the last two values In the version.
- The creation date can be found at runtime using the following algorithm:
Dim version = Assembly.GetExecutingAssembly().GetName().Version
Dim creationDate = New DateTime(2000, 1, 1).AddDays(version.Build).AddSeconds(version.MinorRevision * 2)| Name | Type | Description |
|---|---|---|
assm | Assembly | - |
DateTime, Int32, Int32)CalculateCompileTime 的逆运算:根据编译时间反推对应的 Version 对象。 Build = 距离 2000-01-01 的天数;MinorRevision = 编译时刻距当日 00:00:00 的秒数 / 2(向下取整)。
| Name | Type | Description |
|---|---|---|
compileTime | DateTime | 编译时间(应为本地时间,与正向运算使用的 DateTime 类型一致)。 |
major | Int32 | 主版本号,默认 1(对应 AssemblyVersion("1.0.*") 模式)。 |
minor | Int32 | 次版本号,默认 0(对应 AssemblyVersion("1.0.*") 模式)。 |
还原出的 Version 对象;若 compileTime 为 Nothing 则返回 Nothing。
获取对当前运行时环境的描述
获取当前进程的exe文件的程序描述信息,直接使用New申明得到的只是运行时核心模块dll文件的信息
Assembly)Get the name of the system provider name from the assembly
| Name | Type | Description |
|---|---|---|
assm | Assembly | - |
Assembly)Get System version from the assembly
| Name | Type | Description |
|---|---|---|
assembly | Assembly | - |
Assembly)Get the name of the System from the assembly
| Name | Type | Description |
|---|---|---|
assembly | Assembly | - |
Assembly)Get the copyRights details from the assembly
| Name | Type | Description |
|---|---|---|
assembly | Assembly | - |
Assembly)Get the Product tile from the assembly
| Name | Type | Description |
|---|---|---|
assembly | Assembly | - |
Assembly)Get the description of the product from the assembly
| Name | Type | Description |
|---|---|---|
assembly | Assembly | - |
Assembly)Type)Assembly)Assembly)Assembly)Assembly)