本文整理汇总了VB.NET中System.Diagnostics.FileVersionInfo.GetVersionInfo方法的典型用法代码示例。如果您正苦于以下问题:VB.NET FileVersionInfo.GetVersionInfo方法的具体用法?VB.NET FileVersionInfo.GetVersionInfo怎么用?VB.NET FileVersionInfo.GetVersionInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.FileVersionInfo
的用法示例。
在下文中一共展示了FileVersionInfo.GetVersionInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Class1
' 导入命名空间
Imports System.IO
Imports System.Diagnostics
Class Class1
Public Shared Sub Main(ByVal args() As String)
' Get the file version for the notepad.
' Use either of the following two commands.
FileVersionInfo.GetVersionInfo(Path.Combine(Environment.SystemDirectory, "Notepad.exe"))
Dim myFileVersionInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(Environment.SystemDirectory + "\Notepad.exe")
' Print the file name and version number.
Console.WriteLine("File: " + myFileVersionInfo.FileDescription + vbLf + "Version number: " + myFileVersionInfo.FileVersion)
End Sub
End Class
示例2: Tester
' 导入命名空间
Imports System
Imports System.IO
Imports System.Data
Imports System.Drawing
Imports System.Diagnostics
Imports System.ComponentModel
Public Class Tester
Public Shared Sub Main
Dim m_File As FileVersionInfo
m_File = FileVersionInfo.GetVersionInfo("c:\\test.txt")
Console.WriteLine(m_File.FileName)
Console.WriteLine(m_File.FileName.Substring(m_File.FileName.LastIndexOf("\") + 1))
Console.WriteLine(m_File.Comments)
Console.WriteLine(m_File.CompanyName)
Console.WriteLine(m_File.FileVersion)
Console.WriteLine(m_File.ProductVersion)
Console.WriteLine(m_File.ProductName)
Console.WriteLine(m_File.FilePrivatePart)
Console.WriteLine(m_File.FileDescription)
Console.WriteLine(m_File.Language)
Console.WriteLine(m_File.LegalTrademarks)
Console.WriteLine(m_File.OriginalFilename)
Console.WriteLine(m_File.SpecialBuild)
End Sub
End Class