Ejemplo n.º 1
0
        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( );
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
 public FormModbusAlien( )
 {
     InitializeComponent( );
     logNet = new HslCommunication.LogNet.LogNetSingle("modbus.txt");
 }
Ejemplo n.º 4
0
 public FormDtuServer( )
 {
     InitializeComponent( );
     logNet = new HslCommunication.LogNet.LogNetSingle("");
 }
Ejemplo n.º 5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            button2.Enabled = false;

            LogNet = new HslCommunication.LogNet.LogNetSingle(Application.StartupPath + @"\log.txt");
        }