//重置打印码,将原来的print_code设为未用,并选择新的print_code设为已用 public void resetPrintCode() { string new_code = HttpTool.sendPost(RESET_PRINTER_CODE_URL, "uid=" + uid); Properties.Settings.Default.print_code = new_code; ImageTool.logLog("print_code=" + new_code); Properties.Settings.Default.Save(); }
string uid; // 全球唯一标示符 // WxPrinter的构造方法 public WxPrinter(HomeForm homeForm, string sUid) { myHomeForm = homeForm; myPrintServer = new PrintService(this); myImageTool = new ImageTool(this); uid = sUid; // 向服务器注册当前打印机 string code = HttpTool.sendPost(ADD_PRINTER_UID_URL, "uid=" + uid); Properties.Settings.Default.print_code = code; Properties.Settings.Default.Save(); }
//获取需要打印的照片的URL private string getTaskUrl() { string newTaskUrl = HttpTool.sendPost(WxPrinter.GET_TASK_IMAGE_URL, "print_code=" + Properties.Settings.Default.print_code); return(newTaskUrl); }