当前位置:网站首页>Self increment of version number
Self increment of version number
2022-07-21 16:09:00 【I Can -Jiang】
#region Version number
private string AutoUpgradeVersion(string version)
{
if (string.IsNullOrEmpty(version))
{
version = "1.0.0.0";
}
// Disassemble the version number into an integer array
int[] ints = Array.ConvertAll<string, int>(version.Split('.'), s => Convert.ToInt32(s));
// Recursively call
AutoUpgradeVersion(ints, ints.Length - 1);
// Array to string
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
边栏推荐
- 虚拟环境中的动态特性和交互
- 【JS】鼠标跟随
- [JS] tab switching
- Facebook will reduce resources related to news products and focus on meta universe and short video content creation
- C | file operation
- TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
- Wechat vaccine reservation applet graduation design of applet completion work (3) background function
- 利用 vtk 的控件画圆和矩形
- Esp32-cam - intranet penetration tutorial
- LabVIEW实时监测和绘制单晶光伏板电压电流和能耗趋势
猜你喜欢
[Yugong series] go teaching course in July 2022 014 arithmetic operators of operators
【STC15控制WS2812 RGB彩灯级联】
【愚公系列】2022年7月 Go教学课程 014-运算符之算术运算符
小程序毕设作品之微信疫苗预约小程序毕业设计(3)后台功能
Shape and boundary-aware multi-branch model for semi-supervised medical image segmentation
EasyGBS平台设置小技巧:如何隐藏平台web页面不被访问?
Wechat vaccine appointment applet graduation design (5) assignment book of applet completion work
Daily question-leetcode1260-2d grid migration array mapping
【JS】动态渲染页面
c || 数组与指针
随机推荐
Training of head and neck segmentation networks with shape prior on small datasets
Get the current dimension style dimstyle
Training of head and neck segmentation networks with shape prior on small datasets
i2c client驱动之IIO设备驱动
Wechat applet - "data binding and event binding"
Five reasons why developers use Klocwork for software security
Wechat vaccine appointment applet graduation project of applet completion work (6) opening defense ppt
Blueprism tool menu bar user rights function description -rpa Chapter 2
解决突然跳出命令行(闪烁)
Imitate the widget control of VTK, and make the control that draws a rectangle
LabVIEW monitors and plots the voltage, current and energy consumption trend of single crystal photovoltaic panels in real time
Algorithm summary] 20 questions to complete bat interview - binary tree
【JS】鼠标跟随
小程序毕设作品之微信疫苗预约小程序毕业设计(5)任务书
Is there any risk for the top ten securities companies to open accounts? Is it safe?
c || 结构体 联合体 枚举类型
利用 vtk 的控件画圆和矩形
ROS from entry to mastery (x) TF coordinate transformation principle, why do you need TF transformation?
i2c client驱动
Which is the best multilingual mall system? Comparison of three famous cross-border e-commerce manufacturers