int iSpot = 0; //采集线程停止 public Form1() { if ("Z1W0D3QF" != Pfun.GetMainHardDiskId()) { //System.Environment.Exit(0); } InitializeComponent(); dt_user.Columns.Add("site_ID", System.Type.GetType("System.Int32")); dt_user.Columns.Add("name", System.Type.GetType("System.String")); dt_user.Columns.Add("UserObj", System.Type.GetType("System.Object")); user = database.Querydt("select * from user"); DataRow dr = user.Rows[0]; textBox5.Text = dr["name"].ToString(); Console.WriteLine(dr["name"]); //Gva.ReadOnly = true; //Gva.RowHeadersVisible = false; //Gvb.ReadOnly = true; //Gvb.RowHeadersVisible = false; //Gva.AllowUserToResizeColumns = false; //禁止用户改变DataGridView1の所有行的行高 //Gva.AllowUserToResizeRows = false; //Gvb.AllowUserToResizeColumns = false; //禁止用户改变DataGridView1の所有行的行高 //Gvb.AllowUserToResizeRows = false; //Gvb.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; Conf.ConfInit(); textBox1.Text = Conf.dSw1.ToString(); textBox2.Text = Conf.dSw2.ToString(); textBox3.Text = Conf.htis.ToString(); textBox4.Text = Conf.money.ToString(); checkBox1.Checked = Conf.bDqiu; checkBox2.Checked = Conf.bXqiu; checkBox3.Checked = Conf.d25; Gva.DataSource = Conf.WhereLianSai; for (int j = 0; j < Gvb.Columns.Count; j++) { //Gva.Columns[j].Width = 20; } Gva.Columns[0].Width = 20; Gva.Columns[1].Width = 80; //Gva.AutoGenerateColumns = false; //button9.Visible = false; //button7.Visible = false; }