/// <summary> /// 从文件中读取初始化连接界面的内容 /// </summary> private void initFromFile() { Init_Load(); cb_spliceRows.SelectedIndex = settingFile.ReadInteger("SETTING", "Row", 2) - 1; //设置下拉,行 cb_spliceCols.SelectedIndex = settingFile.ReadInteger("SETTING", "Col", 2) - 1; //设置下拉,列 //tb_sceDirectoryName.Text = settingFile.ReadString("SETTING", "CurrDirect", Application.StartupPath + "\\myWall");//当前连接场景文件夹 //int k = settingFile.ReadInteger("SETTING", "Resolution", tb_sceDirectoryName.Text.Length);//分辨率 //tb_sceDirectoryName.Text = tb_sceDirectoryName.Text.Substring(0, k); //端口数 nud_DVICount.Value = settingFile.ReadInteger("Matrix", "DVICount", 0); nud_VIDEOCount.Value = settingFile.ReadInteger("Matrix", "VIDEOCount", 0); nud_VGACount.Value = settingFile.ReadInteger("Matrix", "VGACount", 0); nud_HDMICount.Value = settingFile.ReadInteger("Matrix", "HDMICount", 0); nud_YPbPrCount.Value = settingFile.ReadInteger("Matrix", "YPbPrCount", 0); //信源地址 nud_DVIAddress.Value = settingFile.ReadInteger("Matrix", "DVIAddress", 0); nud_VIDEOAddress.Value = settingFile.ReadInteger("Matrix", "VIDEOAddress", 0); nud_VGAAddress.Value = settingFile.ReadInteger("Matrix", "VGAAddress", 0); nud_HDMIAddress.Value = settingFile.ReadInteger("Matrix", "HDMIAddress", 0); nud_YPbPrAddress.Value = settingFile.ReadInteger("Matrix", "YPbPrAddress", 0); //信源矩阵选用 comboBox_dvi.SelectedIndex = settingFile.ReadInteger("Matrix", "DVIMatrix", 0); comboBox_video.SelectedIndex = settingFile.ReadInteger("Matrix", "VIDEOMatrix", 0); comboBox_vga.SelectedIndex = settingFile.ReadInteger("Matrix", "VGAMatrix", 0); comboBox_hdmi.SelectedIndex = settingFile.ReadInteger("Matrix", "HDMIMatrix", 0); nud_YPbPrMatrix.Value = settingFile.ReadInteger("Matrix", "YPbPrMatrix", 0); //numericUpDown1.Value = settingFile.ReadInteger("SETTING", "Matrix_time", 200); comboBox1.SelectedIndex = settingFile.ReadInteger("SETTING", "Matrix_time", 1); string s1 = settingFile.ReadString("SETTING", "Pwd", "0"); if (s1 == "0") { button2.Enabled = false; button3.Enabled = false; textBox2.Enabled = false; groupBox6.Enabled = false; button_AddPro.Enabled = false; } else { button2.Enabled = true; button3.Enabled = true; textBox2.Enabled = true; groupBox6.Enabled = true; button_AddPro.Enabled = true; } int s_M = settingFile.ReadInteger("SETTING", "Motherboard", 0); if (s_M == 0) { radioButton4.Checked = true; groupBox2.Enabled = false; groupBox3.Enabled = false; groupBox4.Enabled = false; } else if (s_M == 1) { radioButton5.Checked = true; groupBox3.Enabled = false; groupBox4.Enabled = false; } else if (s_M == 4) { radioButton7.Checked = true; groupBox3.Enabled = false; groupBox4.Enabled = false; } else if (s_M == 2) { radioButton6.Checked = true; groupBox3.Enabled = true; groupBox4.Enabled = false; } else { radioButton3.Checked = true; groupBox3.Enabled = false; groupBox4.Enabled = false; } int n = settingFile.ReadInteger("SETTING", "Matrix_flag", 0); if (n == 1) { radioButton2.Checked = true; } else { radioButton1.Checked = true; } string s = settingFile.ReadString("SETTING", "PicturePath", ""); //Console.WriteLine("s ====" + s); if (!s.Equals("")) { s = s.Substring(s.Length - 4, 4); s = Application.StartupPath + @"\pic\logo" + s; pictureBox1.Image.Dispose(); pictureBox1.Load(s); } textBox1.Text = s; bool PN = settingFile.ReadBool("SETTING", "NameFlag", false); if (PN) { textBox2.Text = settingFile.ReadString("SETTING", "NamePath", "液晶拼接控制系统"); } }