Exemple #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            String versionlocal = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            label3.Text = versionlocal;
            version version = new version();
            getData getData = new getData();

            getData.getiprouter();
            //if (version.judgeversion(versionlocal) == true)
            //{
            //    this.Close();
            //    downloadexe downloadexe = new downloadexe();
            //    downloadexe.Show();
            //}
            //else
            //{
            System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName("ztoffice"); //获取指定的进程名
            if (myProcesses.Length > 1)                                                                           //如果可以获取到知道的进程名则说明已经启动
            {
                MessageBox.Show("程序已启动!");
                Application.Exit();              //关闭系统
            }

            this.txtZerenren1.Text = Properties.Settings.Default.name;
            bool flag = Properties.Settings.Default.isrem;

            if (flag)
            {
                string sql_pass = "******" + txtZerenren1.Text.Trim() + "'";
                String password = Convert.ToString(SQLhelp.ExecuteScalar(sql_pass, CommandType.Text));
                this.checkbox1.Checked = true;
                this.txtPwd.Text       = password;
            }

            string    sql  = "select 用户名 from tb_operator";
            DataTable aaaa = SQLhelp.GetDataTable(sql, CommandType.Text);


            List <string> spaceminute = new List <string>();

            for (int i = 0; i < aaaa.Rows.Count; i++)
            {
                string n = aaaa.Rows[i]["用户名"].ToString();
                spaceminute.Add(n);
            }


            foreach (string s in spaceminute)
            {
                //comboBox1.Items.Add(s);
            }
            //}
        }