当前位置:网站首页>版本号自增
版本号自增
2022-07-20 20:48:00 【I Can -Jiang】
#region 版本号
private string AutoUpgradeVersion(string version)
{
if (string.IsNullOrEmpty(version))
{
version = "1.0.0.0";
}
//将版本号拆解成整数数组
int[] ints = Array.ConvertAll<string, int>(version.Split('.'), s => Convert.ToInt32(s));
//递归调用
AutoUpgradeVersion(ints, ints.Length - 1);
//数组转字符串
version = string.Join(".", ints);
return version;
}
private void AutoUpgradeVersion(int[] ints, int index)
{
if (index == 0)
{
ints[0] = ints[0] + 1;
}
else
{
int value = ints[index] + 1;
if (value < 10)
{
ints[index] = value;
}
else
{
ints[index] = 0;
AutoUpgradeVersion(ints, index - 1);
}
}
}
#endregion
边栏推荐
- Indiscriminate use of "termination", the signal pours on the street
- Audience analysis and uninstall analysis have been comprehensively upgraded, and HMS core analysis service version 6.6.0 has been updated
- nacos集群搭建
- Kingbasees database administrator's Guide -- 15.3 Management synonyms
- 金融企业出海新兴市场机遇与挑战并存,ADVANCE.AI保障其安全合规发展
- openGauss内核分析:查询重写
- [untitled]
- 【LeetCode】29、 两数相除
- 金仓数据库KingbaseES数据库管理员指南--18数据库作业调度
- DS(Tree)
猜你喜欢
The first blog experts to obtain entity certificates on the list
有些测试,还真不是你够努力就能测出来的
SAP 电商云 Spartacus UI Store 相关的设计明细
巧用RoaringBitMap处理海量数据内存diff问题
openGauss内核分析:查询重写
当PCB设计师遇到爱情,猜猜他板内的阻抗有多大变化
DAMA-第八章(数据集成与互操作)
Audience analysis and uninstall analysis have been comprehensively upgraded, and HMS core analysis service version 6.6.0 has been updated
PLC的通信模式
【小程序】快来开发你的第一个微信小游戏(详细流程)
随机推荐
double、float、long占几个字节?
Contract development using rust on Solana
Mysql的主键UUID、自增ID、雪花算法到底该怎么选择?(荣耀典藏版)
Intel汇编语言程序设计学习-第五章 过程-上
【C 练习】将字符串中的空格转换为「%20」
金仓数据库KingbaseES数据库管理员指南--14索引的管理
【快速上手教程3】疯壳·开源编队无人机-开发环境搭建
有些测试,还真不是你够努力就能测出来的
Intel assembly language programming learning - Chapter 5 process - Part 1
浅聊一下 布隆过滤器
[binary tree] maximum product of split binary tree
Let's talk about bron filter
There are some tests that you can't test hard enough
如何给selenium.chrome写扩展拦截或转发请求
[CVA valuation training camp] read the annual reports of listed companies_ Lesson 2
Rust language - tuple
service和systemctl的区别/修改PATH的方法/一条命令查看IP地址和网关以及DNS服务器
From fail to pass, what did DDR debugging go through?
How many bytes do double, float and long occupy?
Arithmetic operator 2 (Gretel software - Jiuye practical training)