using CnasSynchronusClient; using CnasSynchrousModel; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WF_ChangeGUID { public partial class frmMain : Form { List lstSyncInstrument = new List(); public frmMain() { InitializeComponent(); } /// /// 保存 /// /// /// private void button1_Click(object sender, EventArgs e) { if (FileOperation.SaveLocalSyncInStrumentData(lstSyncInstrument)) MessageBox.Show("保存成功"); else MessageBox.Show("保存失败"); } /// /// 非加密方式打开 /// /// /// private void button3_Click(object sender, EventArgs e) { listBox1.Items.Clear(); lstSyncInstrument = FileOperation.GetLocalSyncInStrumentData_NoDecrypt(); if (lstSyncInstrument.Count > 0) { foreach (SyncInstrumentItemInfo item in lstSyncInstrument) { listBox1.Items.Add(item.Code); listBox1.Items.Add(item.GUID); } } } private void button2_Click(object sender, EventArgs e) { if (lstSyncInstrument.Count <= 0) { MessageBox.Show("没有读取到配置数据!"); return; } foreach (SyncInstrumentItemInfo item in lstSyncInstrument) { item.GUID = Guid.NewGuid().ToString(); listBox2.Items.Add(item.Code); listBox2.Items.Add(item.GUID); } } private void btnOpenJiaMi_Click(object sender, EventArgs e) { lstSyncInstrument = FileOperation.GetLocalSyncInStrumentData(); if (lstSyncInstrument.Count > 0) { foreach (SyncInstrumentItemInfo item in lstSyncInstrument) { //item.GUID = Guid.NewGuid().ToString(); listBox1.Items.Add(item.Code); listBox1.Items.Add(item.GUID); } } } } }