/// <summary> /// 给定所需要的序号前缀、数字部分长度、开始数字、序号数量返回一批需要的序号字符串(序号数组) /// </summary> /// <param name="snStarting">字符串前缀</param> /// <param name="numberLength">数字部分长度</param> /// <param name="numberStart">开始数字</param> /// <param name="snNumber">数量</param> /// <returns>字符串数组</returns> private string[] getSnArray(string snStarting, int numberLength, int numberStart,int snNumber) { string[] snTxt = new string[snNumber];//定义数组、成员个数 ///数字补0计算 string tempZone;//补0字符串变量 int tempLength = 0;//补0个数变量 //int tempZoneLengthStart = numberLength - numberStartingLength;//初始补0个数 for (int i = 0; i < snNumber; i++) { tempZone = "";//初始化补0字符串 tempLength = numberLength - numberStart.ToString().Length;//补0个数=数字部分长度-初始数字长度 for (int j = 1; j <= tempLength; j++) { tempZone = tempZone + "0"; }//补零 snTxt[i] = snStarting + tempZone + numberStart.ToString();//输出单个序号 numberStart++;//数字部分+1为下一次循环做准备 } return snTxt; }