private void button1_Click(object sender, EventArgs e) { int type = skinComboBox1.SelectedIndex; normalPrinter np = new normalPrinter(); string[] normaltaskarray = new string[6]; /* * 0,二维码前缀如http:// cpc * * 1,名称 重量 * 2,产地 * 3,生产日期 * 4,批号 * 5,厂家名称 company_name * */ normaltaskarray[0] = skinTextBox2.Text; normaltaskarray[1] = info[1] + info[2]; normaltaskarray[2] = info[2]; normaltaskarray[3] = info[5]; normaltaskarray[5] = "厂家:" + myUser.company_name; normaltaskarray[4] = info[4]; PrintStatus one = new PrintStatus(); one.totalNum = Convert.ToInt32(this.info[2]); one.print_task = info[0]; List <string> normallistCode = new List <string>(); for (int i = 0; i < 5; i++) { string s = "1234567890123456789012345678^2"; normallistCode.Add(s); } if (type == 1) {//三列 np.PrintThree(normaltaskarray, normallistCode, one); } else {//两列 } }
private void printThread(string[] taskarray, List <string> listCode) { if (myUser.curPrinter[1].Length < 8) { normalPrinter print_N = new normalPrinter(); // print_N.init(); // print_N.PrintThree(taskarray, listCode); listView1.Items.Remove(this.listView1.SelectedItems[0]); } else { this.listView1.SelectedItems[0].SubItems[7].Text = myUser.curPrinter[0] + "打印中"; int index = this.listView1.SelectedItems[0].Index; this.label3.Text = ":打印中"; this.listView1.SelectedItems[0].SubItems[8].Text = myUser.curPrinter[0]; PrintStatus one = new PrintStatus(); one.index = index; //one.printName = myUser.curPrinter[0]; one.totalNum = Convert.ToInt32(listView1.SelectedItems[0].SubItems[4].Text); one.print_task = listView1.SelectedItems[0].SubItems[1].Text; if (myUser.curPrinter[3].IndexOf("duo") > -1) { BeginPrinting(taskarray, listCode, one, 0); } else if (myUser.curPrinter[3].IndexOf("wdj") > -1) { BeginPrinting(taskarray, listCode, one, 1); } else if (myUser.curPrinter[3].IndexOf("markem") > -1) { BeginPrinting(taskarray, listCode, one, 2); } thread_set_progress = new Thread(new ParameterizedThreadStart(PrintNum)); thread_set_progress.Start(one); } }