标签:nta wing event ons init forms names ogr cto
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.IO; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string path = @"C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe"; //Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MainApp.exe"); MessageBox.Show(GetVersion(path)); } public string GetVersion(string path) { string version = string.Empty; FileVersionInfo file = System.Diagnostics.FileVersionInfo.GetVersionInfo(path); //版本号显示为“主版本号.次版本号.内部版本号.专用部件号”。 //version = String.Format("{0}.{1}.{2}.{3}", file.FileMajorPart, file.FileMinorPart, file.FileBuildPart, file.FilePrivatePart); //使用文件版本信息 version = file.FileVersion; return version; } } }
标签:nta wing event ons init forms names ogr cto
原文地址:https://www.cnblogs.com/gisoracle/p/14508032.html