C#/.NET是否有内置的;版本号“;上课?
我需要跟踪我的C#应用程序中的任意版本号,C#/.NET是否有内置的;版本号“;上课?,c#,.net,versioning,C#,.net,Versioning,我需要跟踪我的C#应用程序中的任意版本号,M+.M+.b+,其中M是“主要的”;M是“次要的”;b是“构建的”;+表示版本号不限于每个数字一位 是否有一个内置类基本上只包含3或4个(第4个是修订号)ints,并提供一些方便的比较函数,还是我需要自己编写?我想会是这样的: class VersionNumber { public int Major; public int Minor; public int Build; public int Revision;
M+.M+.b+
,其中M
是“主要的”;M
是“次要的”;b
是“构建的”;+
表示版本号不限于每个数字一位
是否有一个内置类基本上只包含3或4个(第4个是修订号)int
s,并提供一些方便的比较函数,还是我需要自己编写?我想会是这样的:
class VersionNumber
{
public int Major;
public int Minor;
public int Build;
public int Revision;
static public VersionNumber operator >(VersionNumber number)
{
// Comparison function here.
}
// Other comparison functions and whatnot here.
}
检查此MSDN链接:。类型System.Version
具有以下属性:
- 建造
- 少校
- 重大修订
- 小调
- 米诺雷西翁
- 修改
System.Reflection.Assembly.getExecutionGassembly().GetName().Version
,它返回一个版本对象。啊,谢谢你们两位。如果你把这些评论贴出来,我会接受它们中的任何一个作为答案。