how to show publish version in a textbox?

前端 未结 5 2091
遥遥无期
遥遥无期 2020-12-14 15:29

At the moment I am manually updating the version field (textbox) in my application every time I publish it. I am wondering if there is a way to have my applicat

5条回答
  •  长情又很酷
    2020-12-14 16:18

    Don't forget to check if the application is networkdeployed otherwise it won't work in debug mode.

    if (ApplicationDeployment.IsNetworkDeployed)
    {
        this.Text = string.Format("Your application name - v{0}",
            ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString(4));
    }
    

提交回复
热议问题