Here it is in VB:
Dim strPublishVersion as String = String.Empty
If System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed Then
Dim objAppDeploy As System.Deployment.Application.ApplicationDeployment = System.Deployment.Application.ApplicationDeployment.CurrentDeployment
strPublishVersion = objAppDeploy.CurrentVersion.ToString
Else
strPublishVersion = "Not network deployed"
End If