大家好,欢迎阅览!
本文要写的是,C#进制流水码加减1操作,适用与任何进制,只需要稍微改动即可。
不多说了,上才艺。
进制转换道理很简单,首先将多进制转成十进制,然后+1或者-1,再转成多进制。
首先写一个类,我是写在CommMethod类里面。
public class ConvertChange
{
//Base of 34 exclude I and O
private static string cs = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
private const string initValue = "0001";
//加一
public static string AddOne(string str)
{
if (str == string.Empty)
{
return initValue;
}
Int64 num =