コード例 #1
0
 private void menuItemSetting_Click(object sender, EventArgs e)
 {
     SettingForm dlg = new SettingForm();
     dlg.ShowDialog();
 }
コード例 #2
0
        private void LoginForm_Load(object sender, EventArgs e)
        {
            ////打开电源
            //HTApi.WIrUHFOpenPower();
            //HTApi.WIrUHFConnect(2);
            Scanner.openUHF();

            //最大化
            this.WindowState = FormWindowState.Maximized;

            //wince下不支持相对路径
            sCodePath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
            sCodePath = sCodePath.Substring(0, sCodePath.LastIndexOf(@"\"));
            //SQLite DB路径
            string sdbFilename = LoginForm.sCodePath + "\\gvdb.db";
            SQLiteHelper.connectionString = "Data Source=" + sdbFilename;

            SettingForm.LoadSetting();

            textBoxUser.Text = SettingForm.sUser;
            textBoxPass.Text = SettingForm.sPass;

            if (textBoxPass.Text.Length != 0)
            {
                checkBoxStorePass.Checked = true;
            }

            if (SettingForm.sClientId.Equals("PC") || SettingForm.sClientId.Length == 0)
            {
                SettingForm.sClientId = "";
                MessageBox.Show("初次使用,请设置客户端ID!\r\n注:请勿与其他手持机重复,否则会发生同步错误!");
                SettingForm dlg = new SettingForm();
                dlg.ShowDialog();
                //初始化同步
                MainForm f = new MainForm(this);
                f.bIsFirstIni = true;
                f.ShowDialog();

            }
            //setting.Load(sCodePath + "\\setting.xml");
            //IniFile f = new IniFile();
            //textBoxIp.Text = f.sIP;
            //textBoxPort.Text = f.sPort;
            //setting = ;
        }