多的不说 直接给代码:
Try Me.Text = "合约买卖点提示V" & Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString() Catch ex As Exception Me.Text = "合约买卖点提示 未知版本" End Try
为啥要用try语句呢?
因为:
Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion是应用程序部署清单里面的信息,需要发布之后才能访问,调试阶段访问会异常报错的。
结果:
<img src="http://img.blog.csdn.net/20160309224325808?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />