Make_RePrintLabel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. using LabelManager2;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Diagnostics;
  7. using System.Drawing;
  8. using System.IO;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading;
  12. using System.Windows.Forms;
  13. using UAS_MES_NEW.DataOperate;
  14. using UAS_MES_NEW.Entity;
  15. using UAS_MES_NEW.PublicForm;
  16. using UAS_MES_NEW.PublicMethod;
  17. namespace UAS_MES_NEW.Make
  18. {
  19. public partial class Make_RePrintLabel : Form
  20. {
  21. DataHelper dh;
  22. public BarTender.Application engine;
  23. LogStringBuilder sql = new LogStringBuilder();
  24. AutoSizeFormClass asc = new AutoSizeFormClass();
  25. ApplicationClass lbl;
  26. Document doc;
  27. Thread InitPrint;//实例化打印进程
  28. DataTable dt;
  29. ftpOperater ftp;
  30. DataTable listA;
  31. string getlabel = "";
  32. DataTable mapB;
  33. String TSN = "";//记录第一次输入的SN
  34. DataTable infoc;
  35. string re_ms_id = "";
  36. string ms_id = "";
  37. DataTable formValue;//界面赋值
  38. string type = "";
  39. string errorMessage = "";
  40. public Make_RePrintLabel()
  41. {
  42. InitializeComponent();
  43. }
  44. private void Make_RePrintLabel_Load(object sender, EventArgs e)
  45. {
  46. asc.controllInitializeSize(this);
  47. Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
  48. Process[] processes1 = System.Diagnostics.Process.GetProcessesByName("bartend");
  49. for (int i = 0; i < processes1.Length; i++)
  50. {
  51. processes1[i].Kill();
  52. }
  53. for (int i = 0; i < processes.Length; i++)
  54. {
  55. processes[i].Kill();
  56. }
  57. OperateResult.AppendText(">>请输入SN\n", Color.Black);
  58. InitPrint = new Thread(InPrint);
  59. SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
  60. BaseUtil.SetFormCenter(stw);
  61. stw.ShowDialog();
  62. inputText.Focus();
  63. dh = SystemInf.dh;
  64. }
  65. private void InPrint()
  66. {
  67. try
  68. {
  69. engine = new BarTender.Application();
  70. lbl = new ApplicationClass();
  71. BaseUtil.WriteLbl();
  72. }
  73. catch (Exception ex)
  74. {
  75. OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
  76. }
  77. }
  78. private void Make_RePrintLabel_SizeChanged(object sender, EventArgs e)
  79. {
  80. //窗体大小变化的时候
  81. asc.controlAutoSize(this);
  82. }
  83. private void Make_RePrintLabel_FormClosing(object sender, FormClosingEventArgs e)
  84. {
  85. //窗口关闭的时候
  86. BaseUtil.ClosePrint(lbl);
  87. if (engine != null)
  88. engine.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
  89. XmlWatcher.EnableRaisingEvents = false;
  90. }
  91. private void radioButton_CheckedChange(object sender, EventArgs e)
  92. {
  93. RadioButton btn = sender as RadioButton;
  94. if ((btn.Name == "giftBox"|| btn.Name == "flBox") && btn.Checked)
  95. {
  96. //如果是切换成彩盒或者机身标提示用户 输入SN
  97. OperateResult.AppendText(">>请输入SN\n", Color.Black);
  98. clearAll();
  99. }
  100. else if (btn.Name == "CartonBox" && btn.Checked)
  101. {
  102. OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
  103. clearAll();
  104. }
  105. else if (btn.Name == "fuselagel" && btn.Checked)
  106. {
  107. OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
  108. clearAll();
  109. }
  110. }
  111. private void inputText_KeyDown(object sender, KeyEventArgs e)
  112. {
  113. //按下enter键
  114. if (e.KeyCode == Keys.Enter)
  115. {
  116. if (inputText.Text == "")
  117. {
  118. OperateResult.AppendText("<<输入不能为空\n", Color.Red);
  119. return;
  120. }
  121. OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
  122. //打印类型为彩盒或者机身标
  123. if (giftBox.Checked||flBox.Checked)
  124. {
  125. //select max(ms_id)ms_id from makeserial where ms_sncode=?
  126. ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
  127. //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
  128. if (ms_id == "")
  129. {
  130. OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
  131. OperateResult.AppendText(">>请输入SN\n", Color.Black);
  132. return;
  133. }
  134. ////判断是否装箱通过
  135. //if (checkPacked())
  136. //{
  137. // return;
  138. //}
  139. //界面赋值
  140. formValue = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='" + ms_id + "'", "select");
  141. BaseUtil.SetFormValue(this.Controls, formValue);
  142. //无值,可补打
  143. inputValue.Text = inputText.Text;
  144. inputText.Text = "";
  145. }
  146. //打印类型为卡通箱
  147. else if (CartonBox.Checked)
  148. {
  149. //查询箱号是否存在
  150. dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
  151. if (dt.Rows.Count == 0)
  152. {
  153. //无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
  154. OperateResult.AppendText("<<箱号:" + inputText.Text + "不存在\n", Color.Red, inputText);
  155. OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
  156. return;
  157. }
  158. //界面赋值
  159. BaseUtil.SetFormValue(this.Controls, dt);
  160. //有值,可以打
  161. //展示产品编号和标签模板到界面
  162. inputValue.Text = inputText.Text;
  163. inputText.Text = "";
  164. }//打印类型为栈板
  165. else if (fuselagel.Checked)
  166. {
  167. //查询箱号是否存在
  168. dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=3", "select");
  169. if (dt.Rows.Count == 0)
  170. {
  171. //无值,返回提示用户“箱号不存在”, “>>请输入卡通箱号”
  172. OperateResult.AppendText("<<栈板号:" + inputText.Text + "不存在\n", Color.Red, inputText);
  173. OperateResult.AppendText(">>请输入栈板号\n", Color.Black);
  174. return;
  175. }
  176. //界面赋值
  177. BaseUtil.SetFormValue(this.Controls, dt);
  178. //有值,可以打
  179. //展示产品编号和标签模板到界面
  180. inputValue.Text = inputText.Text;
  181. inputText.Text = "";
  182. }
  183. print_Click(sender, new EventArgs());
  184. }
  185. }
  186. private void PrintLabel_TextChanged(object sender, EventArgs e)
  187. {
  188. if (pr_code.Text == "")
  189. {
  190. return;
  191. }
  192. if (fuselagel.Checked)
  193. type = "栈板标";
  194. else if (flBox.Checked)
  195. type = "机身标";
  196. else if (giftBox.Checked)
  197. type = "彩盒标";
  198. else
  199. type = "卡通箱标";
  200. getlabel = "select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='" + type + "' and la_statuscode='AUDITED' order by la_isdefault";
  201. listA = (DataTable)dh.ExecuteSql(getlabel, "select");
  202. if (listA.Rows.Count == 0)
  203. {
  204. OperateResult.AppendText("<<产品:" + pr_code.Text + "未维护" + type + "模板\n", Color.Red);
  205. }
  206. PrintLabel.DataSource = listA;
  207. PrintLabel.DisplayMember = "la_url";
  208. PrintLabel.ValueMember = "la_id";
  209. }
  210. private void print_Click(object sender, EventArgs e)
  211. {
  212. //输入值字段值不为空,打印不为空,有选中打印模板,才可以进行打印,打印前再次判断
  213. if (inputValue.Text == "")
  214. {
  215. OperateResult.AppendText("<<无箱号或者序列号\n", Color.Red);
  216. return;
  217. }
  218. if (PrintLabel.Text == "")
  219. {
  220. OperateResult.AppendText("<<无打印模板\n", Color.Red);
  221. return;
  222. }
  223. //打印类型 彩盒或者标签,再次判断是否已装箱,未转号
  224. if (giftBox.Checked||flBox.Checked)
  225. {
  226. mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
  227. if (mapB.Rows.Count == 0)
  228. {
  229. //无值提示用户序列号错误,不存在或者已经发生转号
  230. OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
  231. return;
  232. }
  233. ////如果ms_outboxcode 不为空,则提示用户,已经装箱不允许单独打印
  234. //if (mapB.Rows[0]["ms_outboxcode"].ToString() != "")
  235. //{
  236. // OperateResult.AppendText("<<SN:" + inputValue.Text + "已经装箱" + mapB.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red);
  237. // return;
  238. //}
  239. //判定通过进行打印
  240. //doc = lbl.Documents.Open(PrintLabel.Text);
  241. if (PrintLabel.Text.ToUpper().Contains(".BTW"))
  242. {
  243. if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
  244. {
  245. //按照打印张数打印
  246. OperateResult.AppendText("<<打印成功\n", Color.Green);
  247. }
  248. else
  249. {
  250. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  251. }
  252. }
  253. else
  254. {
  255. if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, giftBox.Checked ? "彩盒标" : "机身标", "-1", out errorMessage))
  256. {
  257. //按照打印张数打印
  258. OperateResult.AppendText("<<打印成功\n", Color.Green);
  259. }
  260. else
  261. {
  262. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  263. }
  264. }
  265. //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
  266. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
  267. ////如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
  268. //if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
  269. //{
  270. // dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
  271. // //插入数据
  272. // putInfo2MakeDown();
  273. //}
  274. }
  275. //打印类型为卡通箱标签
  276. else if (CartonBox.Checked)
  277. {
  278. //select pa_downstatus from package where pa_outboxcode=? 输入值code
  279. mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
  280. //无值提示用户箱号错误,不存在。
  281. if (mapB.Rows.Count == 0)
  282. {
  283. OperateResult.AppendText("<<箱号:" + inputValue.Text + "错误,不存在\n", Color.Red);
  284. return;
  285. }
  286. //doc = lbl.Documents.Open(PrintLabel.Text);
  287. if (PrintLabel.Text.ToUpper().Contains(".BTW"))
  288. {
  289. if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
  290. {
  291. //判断通过,打印
  292. OperateResult.AppendText("<<打印成功\n", Color.Green);
  293. }
  294. else
  295. {
  296. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  297. }
  298. }
  299. else
  300. {
  301. if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "卡通箱标", "-1", out errorMessage))
  302. {
  303. //判断通过,打印
  304. OperateResult.AppendText("<<打印成功\n", Color.Green);
  305. }
  306. else
  307. {
  308. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  309. }
  310. }
  311. //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
  312. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
  313. ////如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
  314. //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
  315. //{
  316. // dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
  317. // //插入MakeDown表
  318. // putInfo2MakeDown();
  319. //}
  320. }
  321. //打印类型为栈板标签
  322. else if (fuselagel.Checked)
  323. {
  324. //select pa_downstatus from package where pa_outboxcode=? 输入值code
  325. mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
  326. //无值提示用户箱号错误,不存在。
  327. if (mapB.Rows.Count == 0)
  328. {
  329. OperateResult.AppendText("<<栈板标号:" + inputValue.Text + "错误,不存在\n", Color.Red);
  330. return;
  331. }
  332. //doc = lbl.Documents.Open(PrintLabel.Text);
  333. if (PrintLabel.Text.ToUpper().Contains(".BTW"))
  334. {
  335. if (Print.SinglePrint(Tag.ToString(), engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "栈板标", "-1", out errorMessage))
  336. {
  337. //判断通过,打印
  338. OperateResult.AppendText("<<打印成功\n", Color.Green);
  339. }
  340. else
  341. {
  342. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  343. }
  344. }
  345. else
  346. {
  347. if (Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), ms_makecode.Text, pr_code.Text, "栈板标", "-1", out errorMessage))
  348. {
  349. //判断通过,打印
  350. OperateResult.AppendText("<<打印成功\n", Color.Green);
  351. }
  352. else
  353. {
  354. OperateResult.AppendText(errorMessage + "\n", Color.Red);
  355. }
  356. }
  357. //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
  358. LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板标标签补打印,栈板标号:" + inputValue.Text, "补打印成功", inputValue.Text, "");
  359. ////如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
  360. //if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
  361. //{
  362. // dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
  363. // //插入MakeDown表
  364. // putInfo2MakeDown();
  365. //}
  366. }
  367. }
  368. /// <summary>
  369. /// 判断彩盒和机身标序列是否已经装箱
  370. /// </summary>
  371. /// <returns></returns>
  372. private bool checkPacked()
  373. {
  374. //如果存在,则判断是否装箱
  375. dt = (DataTable)dh.ExecuteSql("select ms_id,ms_prodcode,ms_makecode,pr_detail, ms_outboxcode from makeserial left join product on pr_code=ms_prodcode where ms_id='" + ms_id + "'", "select");
  376. //判断ms_outboxcode 是否为空,如果有值,则返回提示用户“已经装箱
  377. if (dt.Rows.Count == 0)
  378. {
  379. OperateResult.AppendText("<<SN:" + inputText.Text + "不存在\n", Color.Red, inputText);
  380. return true;
  381. }
  382. if (dt.Rows[0]["ms_outboxcode"].ToString() != "")
  383. {
  384. OperateResult.AppendText("<<SN:" + inputText.Text + "已经装箱" + dt.Rows[0]["ms_outboxcode"].ToString() + "不允许单独补打\n", Color.Red, inputText);
  385. return true;
  386. }
  387. return false;
  388. }
  389. /// <summary>
  390. /// 插入表MAKEDOWN
  391. /// </summary>
  392. private void putInfo2MakeDown()
  393. {
  394. //插入数据至表MAKEDOWN
  395. string md_code = "";
  396. LogicHandler.GetSerialNumByCaller("MakeDown", out md_code);
  397. sql.Clear();
  398. sql.Append("INSERT INTO MAKEDOWN (MD_ID,MD_LINECODE,MD_SCCODE,MD_STEPCODE,");
  399. sql.Append((CartonBox.Checked ? "MD_OUTBOXCODE" : "MD_SNCODE") + ",MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
  400. sql.Append("MD_DOWNDATE,MD_DOWNMAN,MD_STATUS) values (MAKEDOWN_seq.nextval,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
  401. sql.Append("'" + User.CurrentStepCode + "','" + inputValue.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','补打标签','" + md_code + "',sysdate,'" + User.UserCode + "','-1')");
  402. dh.ExecuteSql(sql.GetString(), "insert");
  403. }
  404. private void rePrintCheck_KeyDown(object sender, KeyEventArgs e)
  405. {
  406. }
  407. /// <summary>
  408. /// 清除信息
  409. /// </summary>
  410. private void clearAll()
  411. {
  412. //清除输入值、工单代码、产品编号,名称、打印模板、核对第一次输入的SN
  413. inputValue.Text = "";
  414. ms_makecode.Text = "";
  415. pr_code.Text = "";
  416. pr_detail.Text = "";
  417. TSN = "";
  418. if (listA != null)
  419. {
  420. listA.Clear();
  421. }
  422. }
  423. private void XmlWatcher_Created(object sender, System.IO.FileSystemEventArgs e)
  424. {
  425. while (true)
  426. {
  427. try
  428. {
  429. using (Stream stream = File.Open(e.FullPath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
  430. {
  431. if (stream != null)
  432. break;
  433. }
  434. }
  435. catch (Exception ex)
  436. {
  437. Console.WriteLine(ex.Message);
  438. }
  439. }
  440. string test_date = "";
  441. string test_result = "";
  442. string test_sn = "";
  443. string imageurl = "";
  444. string oMSID = "";
  445. string oErrMessage = "";
  446. StreamReader _Sr = new StreamReader(FolderPath.Text + @"\" + e.Name, Encoding.UTF8);
  447. OperateResult.AppendText("读取文件" + e.Name+"\n");
  448. _Sr.Close();
  449. //获取文件名的序列号,如SA123456.xml,如果开头为-表示无条码需要自动获取
  450. string sn_code = e.Name.Split('.')[0].Replace("test", "");
  451. inputText.Text = sn_code;
  452. inputText_KeyDown(this, new KeyEventArgs(Keys.Enter));
  453. File.Delete(e.FullPath);
  454. }
  455. private void ChooseFolder_Click(object sender, EventArgs e)
  456. {
  457. FolderBrowserDialog folder = new FolderBrowserDialog();
  458. folder.Description = "选择监控文件夹";
  459. DialogResult result = folder.ShowDialog();
  460. if (result == DialogResult.OK)
  461. {
  462. FolderPath.Text = folder.SelectedPath;
  463. }
  464. }
  465. private void StartWatch_Click(object sender, EventArgs e)
  466. {
  467. if (FolderPath.Text == "")
  468. {
  469. OperateResult.AppendText("请选择监控文件夹\n");
  470. return;
  471. }
  472. else
  473. {
  474. if (!Directory.Exists(FolderPath.Text))
  475. {
  476. OperateResult.AppendText("监控文件夹不存在\n");
  477. return;
  478. }
  479. }
  480. XmlWatcher.Path = FolderPath.Text;
  481. XmlWatcher.Filter = "*.txt";
  482. XmlWatcher.EnableRaisingEvents = true;
  483. //设置缓存数据
  484. BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
  485. //设置按钮不可点击
  486. StartWatch.Enabled = false;
  487. ChooseFolder.Enabled = false;
  488. StopWatch.Enabled = true;
  489. OperateResult.AppendText("开始执行监控\n");
  490. }
  491. private void StopWatch_Click(object sender, EventArgs e)
  492. {
  493. XmlWatcher.EnableRaisingEvents = false;
  494. StartWatch.Enabled = true;
  495. ChooseFolder.Enabled = true;
  496. StopWatch.Enabled = false;
  497. OperateResult.AppendText("停止执行监控\n");
  498. }
  499. }
  500. }