欢迎来到天天文库
浏览记录
ID:14849626
大小:28.50 KB
页数:11页
时间:2018-07-30
《顺丰单号、ems 单号算法(规则 规律)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、顺丰单号、EMS单号算法(规则规律)导读:就爱阅读网友为您分享以下“顺丰单号、EMS单号算法(规则规律)”资讯,希望对您有所帮助,感谢您对92to.com的支持!usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.OleDb;usingMicroso
2、ft.Office.Interop.Excel;usingSystem.Diagnostics;usingSystem.IO;11namespaceRMEmsNum{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}publicintBNum=0;///summary///生成数据写入Access数据库////summary///paramname=“sql”/paramprivatevoidRE(stringsql){stringpath=“Provider=Microsoft.
3、Jet.OLEDB.4.0;DataSource=DONENAME.mdb;”;OleDbConnectionconn=newOleDbConnection(path);OleDbCommandcmd=newOleDbCommand(sql,11conn);conn.Open();try{cmd.ExecuteNonQuery();}catch(Exception){conn.Close();MessageBox.Show(“写入数据失败!”);}conn.Close();}///summary///开始生成Ems数据////summary///paramnam
4、e=“sender”/param///paramname=“e”/paramprivatevoidbtn_Go_Click(objectsender,EventArgse){this.btn_showinfo.Enabled=false;this.btn_ToExcle.Enabled=false;try{if(this.txtBox_Start.Text.Trim()==““
5、
6、11this.txtBox_End.Text.Trim()==““
7、
8、this.txtBox_Start.Text.Trim().Length!=8
9、
10、this.txtBox_End.
11、Text.Trim().Length!=8){MessageBox.Show(“请正确输入编码!编码应为8位全数字!”);}else{//cq078436337sd//cq078436385sdstringstartStr=this.txtBox_Start.Text.Trim();stringendStr=this.txtBox_End.Text.Trim();intstartNum=Convert.ToInt32(startStr.Substring(4,4));intendNum=Convert.ToInt32(endStr.Substring(4,4))
12、;for(inti=startNum;i=endNum;i++){//86423597intnum3=Convert.ToInt32(startStr.Substring(0,1));intnum4=Convert.ToInt32(startStr.Substring(1,1));intnum5=Convert.ToInt32(startStr.Substring(2,111));intnum6=Convert.ToInt32(startStr.Substring(3,1));intnum7=Convert.ToInt32(startStr.Substring(
13、4,1));intnum8=Convert.ToInt32(startStr.Substring(5,1));intnum9=Convert.ToInt32(startStr.Substring(6,1));intnum10=Convert.ToInt32(startStr.Substring(7,1));intlastNum=11-(8*num3+6*num4+4*num5+2*num6+3*num7+5*num8+9*num9+7*num10)%11;if(lastNum==10){lastNum=0;}if(lastNum==11){lastNum=115
14、;}stringsql=
此文档下载收益归作者所有