Exemple #1
0
 public Comuser()
 {
     this.Bot.Clear();
     this.Bot.Add(2400);
     this.Bot.Add(4800);
     this.Bot.Add(9600);
     this.Bot.Add(19200);
     this.Bot.Add(38400);
     this.Bot.Add(57600);
     this.Bot.Add(115200);
     this.Oldbo  = Kuozhan.getxmlstring("oldbo_").Getint();
     this.Oldcom = Kuozhan.getxmlstring("oldcom_");
 }
Exemple #2
0
 private void tanchuang_Load(object sender, EventArgs e)
 {
     this.timer1.Interval = 4000;
     this.timer1.Enabled  = true;
     this.chongshi        = 0;
     this.webBrowser1.Navigate(this.thisadd);
     if (Kuozhan.getxmlstring("st0") == datasize.tanchuangid.ToString())
     {
         this.checkBox1.Checked = true;
     }
     else
     {
         this.checkBox1.Checked = false;
     }
 }
Exemple #3
0
        private static void Loadcodemessage(string key, ref codemessagetype m1)
        {
            string text = Kuozhan.getxmlstring(key);

            if (text != "")
            {
                string[] array = text.Split(new char[]
                {
                    '-'
                });
                if (array.Length == 5)
                {
                    m1.allen     = (byte)array[0].Getint();
                    m1.keyword   = (byte)array[1].Getint();
                    m1.comshow   = (byte)array[2].Getint();
                    m1.mouseshow = (byte)array[3].Getint();
                    m1.codehig   = (byte)array[4].Getint();
                }
            }
        }
Exemple #4
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            string text = Application.StartupPath + "\\hmics.lang";//中英文切换的文件

            if (!File.Exists(text))
            {
                MessageOpen.Show("The file is missing:" + text);
                Application.Exit();
            }
            else
            {
                Kuozhan.LanguageInit();
                datasize.Language = 0;//默认为中文
                if (datasize.Language == 0)
                {
                    datasize.Myencoding        = Encoding.GetEncoding("gb2312");
                    datasize.Objzhushiencoding = Encoding.GetEncoding("gb2312");
                    datasize.hmibiaoshiL       = 84;
                    datasize.softname          = "USART HMI";
                    datasize.Myico             = Resources.tjcico;
                    datasize.verfindaddr       = "http://hmi.tjc1688.com/ver/ver.php"; //返回this is run!
                    datasize.clientupaddr      = "http://hmi.tjc1688.com/ver/up.php";  //返回up is run!
                    datasize.encodes_This      = datasize.encodes_Ch;
                }
                else
                {
                    datasize.Myencoding        = Encoding.GetEncoding("iso-8859-1");
                    datasize.Objzhushiencoding = Encoding.GetEncoding("iso-8859-1");
                    datasize.hmibiaoshiL       = 78;
                    datasize.softname          = "Nextion Editor";
                    datasize.Myico             = Resources.iteadico;
                    datasize.verfindaddr       = "http://nextion.itead.cc/ver/ver.php";
                    datasize.clientupaddr      = "http://nextion.itead.cc/ver/up.php";//链接到厂家在国外的一个网站
                    datasize.encodes_This      = datasize.encodes_En;
                }
                datasize.Modelinit();
                guidatamake.GuidataAppinit();
                datasize.hmibiaoshiH = Convert.ToByte(datasize.hmibiaoshiL + 1);
                Kuozhan.Getlinpath();
                Kuozhan.delkuozhanfile(datasize.linpath, "ca");
                DateTime now = DateTime.Now;
                datasize.runfilepath = string.Concat(new string[]
                {
                    datasize.linpath,
                    "\\",
                    now.Year.ToString(),
                    now.Month.ToString(),
                    now.Day.ToString(),
                    now.Hour.ToString(),
                    now.Minute.ToString(),
                    now.Second.ToString(),
                    ".ca"
                });
                datasize.layout        = datasize.linpath + "\\layout.ini";
                datasize.layout_defaut = Application.StartupPath + "\\layout_defaut.ini";
                datasize.layout_temp   = Application.StartupPath + "\\layout_temp.ini";
                Kuozhan.Getcucolor();
                datasize.historycolors = Kuozhan.getxmlstring("historycolors");
                datasize.myid          = Win32.GetMyID();
                new logon().ShowDialog();
                Thread.Sleep(300);
                if (datasize.dowloadurl != "")
                {
                    if (!(datasize.dowloadurl == "err"))
                    {
                        new download(datasize.dowloadurl).ShowDialog();
                    }
                }
                Program.Loadcodemessage("codemessage0", ref datasize.codemessage[0]);
                Program.Loadcodemessage("codemessage1", ref datasize.codemessage[1]);
                Application.Run(new main());
            }
        }