46 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Text;
 | |
| using System.Linq;
 | |
| using System.Windows.Forms;
 | |
| using DevExpress.XtraEditors;
 | |
| using DeiNiu.Utils;
 | |
| using System.Reflection;
 | |
| using System.Deployment.Application;
 | |
| 
 | |
| namespace DeiNiu.wms.win.utils
 | |
| {
 | |
|     public partial class frmAbout : DevExpress.XtraEditors.XtraForm
 | |
|     {
 | |
|         public frmAbout()
 | |
|         {
 | |
|             InitializeComponent();
 | |
|             StartPosition = FormStartPosition.CenterParent;
 | |
|             lbSvr.Text =string.Format("{0}@{1}",LoginInfo.Account, Park.wareHouse);
 | |
|             lbVersion.Text = "DNWMS v" + getVersiion();
 | |
|         }
 | |
| 
 | |
|         private static string getVersiion()
 | |
|         {
 | |
|             var version = "";
 | |
|             if (ApplicationDeployment.IsNetworkDeployed)//是否已连接
 | |
|             {
 | |
|                 ApplicationDeployment currDeployment = ApplicationDeployment.CurrentDeployment;
 | |
|                 DateTime lastCheck = currDeployment.TimeOfLastUpdateCheck.ToLocalTime();
 | |
|                 var lastDay = lastCheck.Date.ToShortDateString();
 | |
|                 var lastTime = lastCheck.TimeOfDay.ToString();
 | |
|                 var majorVersion = currDeployment.CurrentVersion.Major.ToString();//主版本
 | |
|                 var minorVersion = currDeployment.CurrentVersion.Minor.ToString(); //次版本
 | |
|                 var revisionVersion = currDeployment.CurrentVersion.Revision.ToString();//内部版本号
 | |
|                 var blildVersion = currDeployment.CurrentVersion.Build.ToString();//修订号
 | |
| 
 | |
|                 version = majorVersion + "." + minorVersion + "." + blildVersion + "." + revisionVersion;
 | |
|             }
 | |
|             return version;
 | |
|         }
 | |
| 
 | |
|     }
 | |
| } |