private void Form1_Load(object sender, EventArgs e) { // 加载版本号 if (File.Exists("version.txt")) { textBox1.Text = Encoding.Default.GetString(File.ReadAllBytes("version.txt")); version = new Communication.BasicFramework.SystemVersion(textBox1.Text); } if (File.Exists("version2.txt")) { textBox3.Text = Encoding.Default.GetString(File.ReadAllBytes("version2.txt")); version2 = new Communication.BasicFramework.SystemVersion(textBox3.Text); } if (File.Exists("version3.txt")) { textBox4.Text = Encoding.Default.GetString(File.ReadAllBytes("version3.txt")); version3 = new Communication.BasicFramework.SystemVersion(textBox4.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 Communication.LogNet.LogNetSingle("logs.txt"); lognet.BeforeSaveToFile += LogNet_BeforeSaveToFile; LoadData(); timer.Interval = 3000; timer.Tick += Timer_Tick; timer.Start(); }
public FormModbusAlien( ) { InitializeComponent( ); logNet = new Communication.LogNet.LogNetSingle("modbus.txt"); }