private void Form1_Load(object sender, EventArgs e) { // 加载版本号 if (File.Exists("version.txt")) { textBox1.Text = Encoding.Default.GetString(File.ReadAllBytes("version.txt")); version = new HslCommunication.BasicFramework.SystemVersion(textBox1.Text); } if (File.Exists("version2.txt")) { textBox3.Text = Encoding.Default.GetString(File.ReadAllBytes("version2.txt")); version2 = new HslCommunication.BasicFramework.SystemVersion(textBox3.Text); } if (!Directory.Exists(Application.StartupPath + @"\Demo")) { Directory.CreateDirectory(Application.StartupPath + @"\Demo"); } if (!Directory.Exists(Application.StartupPath + @"\Controls")) { Directory.CreateDirectory(Application.StartupPath + @"\Controls"); } lognet = new HslCommunication.LogNet.LogNetSingle("logs.txt"); lognet.BeforeSaveToFile += LogNet_BeforeSaveToFile; LoadData( ); timer.Interval = 3000; timer.Tick += Timer_Tick; timer.Start( ); }
private void Client_Load(object sender, EventArgs e) { groupBox2.Enabled = false; groupBox3.Enabled = false; userButton2.Enabled = false; LogNet = new HslCommunication.LogNet.LogNetSingle(Application.StartupPath + @"\log.txt"); }
public FormModbusAlien( ) { InitializeComponent( ); logNet = new HslCommunication.LogNet.LogNetSingle("modbus.txt"); }
public FormDtuServer( ) { InitializeComponent( ); logNet = new HslCommunication.LogNet.LogNetSingle(""); }
private void Form1_Load(object sender, EventArgs e) { button2.Enabled = false; LogNet = new HslCommunication.LogNet.LogNetSingle(Application.StartupPath + @"\log.txt"); }