Winform 양식 텍스트에 자동 증가로 설정된 어셈블리 버전 번호를 어떻게 삽입합니까? 이들의Winform 양식의 버전 번호
답변
어느 작동합니다 :
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
this.Text = String.Format("My Application Version {0}", version);
string version = System.Windows.Forms.Application.ProductVersion;
this.Text = String.Format("My Application Version {0}", version);
이가에서 실행되는 가정하고 Form
당신이 여기에서 볼 수 있듯이 당신은
에 텍스트를 표시하려면 : http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.version.aspx
class Example
{
static void Main()
{
Console.WriteLine("The version of the currently executing assembly is: {0}",
Assembly.GetExecutingAssembly().GetName().Version);
Console.WriteLine("The version of mscorlib.dll is: {0}",
typeof(String).Assembly.GetName().Version);
}
}
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
return fvi.ProductVersion;
System.Reflection.AssemblyName
클래스의 예. 나는이 (가)의 WinForm에서 다음을 사용하고
Assembly.GetExecutingAssembly().GetName().Version.ToString()
: 사용자에게 개정 번호를 표시하지
public MainForm()
{
InitializeComponent();
Version version = Assembly.GetExecutingAssembly().GetName().Version;
Text = Text + " " + version.Major + "." + version.Minor + " (build " + version.Build + ")"; //change form title
}
가, 빌드 번호는 충분한 기술 정보를이다
당신의 AssemblyInfo.cs가 끝나는 확인 VisualStudio가 빌드 및 개정 번호를 자동 증가시키기 위해서는 다음과 같이하십시오 (기본적으로이 버전을 제거하십시오).
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
어쨌든이 수정 사항을 게시 할 수 있는지 모르겠어요 어딘가에 다른 어쨌든 사용되는 경우 그것은 명확하게 : 버전 버전 = (ApplicationDeployment.IsNetworkDeployed)? ApplicationDeployment.CurrentDeployment.CurrentVersion : Assembly.GetExecutingAssembly(). GetName(). Version; // 배포 된 네트워크가 게시 된 버전을 표시하는 경우 (웹 설치 페이지 에서처럼) –
Text = Application.ProductVersion
빠른 방법은 (문자열로 전체 버전을 얻을 : 당신은 (당신이 할 때 바로 수정 새로운 기능에 대한 주 버전, 부 버전을 업데이트) 모든 릴리스에서 메이저와 마이너 버전을 직접 업데이트해야 예 : "1.2.3.4")
- 1. .NET 버전 번호 (설치자 버전)
- 2. Subversion 버전 번호 질문
- 3. ASP.Net 버전/빌드 번호
- 4. 자동 버전 번호 지정
- 5. 동시 버전 번호 매기기
- 6. BlackBerry 프로젝트 버전 번호
- 7. 부스트 버전 번호
- 8. className의 버전 번호
- 9. gem 버전 번호 확인
- 10. OSX/xcode의 버전 번호 추적
- 11. grep을 사용하여 버전 번호 찾기
- 12. 레이크를 사용한 버전 번호 생성
- 13. TFS : 어셈블리 버전 번호 관리?
- 14. Windows Mobile, 버전 번호 변경
- 15. .NET 참조 어셈블리 - 버전 번호
- 16. Perl에서 버전 번호 유효성 확인
- 17. Vault가있는 소스의 파일 버전 번호
- 18. AutoIt - 단일 프로세스의 버전 번호
- 19. app_themes css 파일 및 버전 번호
- 20. NCBI C++ 툴킷 앱에서 버전 번호 설정
- 21. Visual Studio Deploy Solution 버전 번호
- 22. 는 "잘못된 버전 번호 문자열 mingw32"레일
- 23. 최소 OS 버전 번호, iPhone 앱
- 24. 코드에서 응용 프로그램 버전 번호 찾기
- 25. 웹 사이트 버전 번호 - 유용하거나 무의미한가요?
- 26. VS 2005 설치자 프로젝트 버전 번호
- 27. 코드 할당 (커밋) 마스터 버전 번호
- 28. C# .net 2.0과 함께 제공되는 버전 번호?
- 29. Eclipse를 사용하여 자바 라이브러리 버전 번호 매기기
- 30. Android 마켓, 스택 추적 버전 번호 - 무엇입니까?
잘 작동합니다. – HerrimanCoder
여전히 빠른 방법이 .Text = Application.ProductVersion –
System.Windows.Forms.Application.ProductVersion –