nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Runtime / ApplicationInfoUtils

ApplicationInfoUtils

Full name Microsoft.VisualBasic.ApplicationServices.Development.ApplicationInfoUtils Assembly Microsoft.VisualBasic.Runtime Members 17

Parsing product assembly meta data

00 Remarks

http://www.c-sharpcorner.com/uploadfile/ravesoft/access-assemblyinfo-file-and-get-product-informations/

01 Syntax

Microsoft.VisualBasic.ApplicationServices.Development.ApplicationInfoUtils

02 Methods

NameOverloadsSummary
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

method RetrieveLinkerTimestamp #
RetrieveLinkerTimestamp(Assembly)

Linker Timestamp

method CalculateCompileTime #
CalculateCompileTime(Assembly)

计算出模块文件的编译时间.(在编译项目之前应该手动修改vbproj文件中的Deterministic配置项的值为False来允许自动递增版本号的特性)

Remarks

Get Compile date and time in application

https://social.msdn.microsoft.com/forums/en-US/172201e0-c47b-40a8-a5d7-0a052cb42532/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.

  1. 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.

  1. 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)
Parameters
NameTypeDescription
assmAssembly

-

method CalculateVersion #
CalculateVersion(DateTime, Int32, Int32)

CalculateCompileTime 的逆运算:根据编译时间反推对应的 Version 对象。 Build = 距离 2000-01-01 的天数;MinorRevision = 编译时刻距当日 00:00:00 的秒数 / 2(向下取整)。

Parameters
NameTypeDescription
compileTimeDateTime

编译时间(应为本地时间,与正向运算使用的 DateTime 类型一致)。

majorInt32

主版本号,默认 1(对应 AssemblyVersion("1.0.*") 模式)。

minorInt32

次版本号,默认 0(对应 AssemblyVersion("1.0.*") 模式)。

Returns

还原出的 Version 对象;若 compileTime 为 Nothing 则返回 Nothing。

method VBCore #
VBCore

获取对当前运行时环境的描述

method CurrentExe #
CurrentExe

获取当前进程的exe文件的程序描述信息,直接使用New申明得到的只是运行时核心模块dll文件的信息

method GetCompanyName #
GetCompanyName(Assembly)

Get the name of the system provider name from the assembly

Parameters
NameTypeDescription
assmAssembly

-

method GetProductVersion #
GetProductVersion(Assembly)

Get System version from the assembly

Parameters
NameTypeDescription
assemblyAssembly

-

method GetProductName #
GetProductName(Assembly)

Get the name of the System from the assembly

Parameters
NameTypeDescription
assemblyAssembly

-

method GetCopyRightsDetail #
GetCopyRightsDetail(Assembly)

Get the copyRights details from the assembly

Parameters
NameTypeDescription
assemblyAssembly

-

method GetProductTitle #
GetProductTitle(Assembly)

Get the Product tile from the assembly

Parameters
NameTypeDescription
assemblyAssembly

-

method GetProductDescription #
GetProductDescription(Assembly)

Get the description of the product from the assembly

Parameters
NameTypeDescription
assemblyAssembly

-

method FromAssembly #
FromAssembly(Assembly)
method FromTypeModule #
FromTypeModule(Type)
method GetGuid #
GetGuid(Assembly)
method GetTargetFramework #
GetTargetFramework(Assembly)
method GetTrademark #
GetTrademark(Assembly)
method GetInformationalVersion #
GetInformationalVersion(Assembly)