怎样得到应用程序的版本号?

解决方案 »

  1.   

    lblVersionNumber.Text = "Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() ;
      

  2.   

    public void GetFileVersion() {
        // Get the file version for the notepad.
        FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("%systemroot%\\Notepad.exe");
     
        // Print the file name and version number.
        textBox1.Text = "File: " + myFileVersionInfo.FileDescription + '\n' +
           "Version number: " + myFileVersionInfo.FileVersion;
     }
    你把文件路径改为你应用程序的就可以了。
      

  3.   

    如果不是.net编写的程序呢?比如delphi写的应用程序。
    还能这样检测??
      

  4.   

    eboywy(飞影)  说的。 。比我的要简单一点。。可行。。我已经试过了。。同时、也感谢 eboywy(飞影) !
      

  5.   

    飞影的是微软自己在treeview里的做法,当然简练:p
      

  6.   

    Sanmao0126()
    只要是用.net类库的都行拉
      

  7.   

    Application.ProductVersion 属性请参见
    Application 类 | Application 成员 | System.Windows.Forms 命名空间 | ProductName | CompanyName | AssemblyVersionAttribute | Application 成员(Visual J# 语法) | C++ 托管扩展编程 
    要求
    平台: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 系列
    语言
    C#C++JScriptVisual Basic全部显示
    获取与该应用程序关联的产品版本。[Visual Basic]
    Public Shared ReadOnly Property ProductVersion As String[C#]
    public static string ProductVersion {get;}[C++]
    public: __property static String* get_ProductVersion();[JScript]
    public static function get ProductVersion() : String;属性值
    产品版本。备注
    通常,版本号显示为“主版本号.次版本号.内部版本号.专用部件号”。