private void btn_true_Click(object sender, EventArgs e) { if (carmerName.Text.Trim() == "" || rtmpUrl.Text.Trim() == "") { MessageBox.Show("请输入摄像头名称或直播地址"); } else { XmlDocumentUntil.addCamera(h_name, carmerName.Text.Trim(), rtmpUrl.Text.Trim()); this.DialogResult = DialogResult.OK; MessageBox.Show("添加成功"); this.Close(); } }
private void Form1_Load(object sender, EventArgs e) { if (XmlDocumentUntil.checkXML()) { this.Hide(); PlayerFrm frm = new PlayerFrm(); frm.ShowDialog(); } else { int x = (System.Windows.Forms.SystemInformation.WorkingArea.Width - this.Size.Width) / 2; int y = (System.Windows.Forms.SystemInformation.WorkingArea.Height - this.Size.Height) / 2; this.StartPosition = FormStartPosition.Manual; //窗体的位置由Location属性决定 this.Location = (Point) new Size(x, y); } }
private void initConfig() { List <Carmer.Carmer> list = new List <Carmer.Carmer>(); if (XmlDocumentUntil.configXml == null) { XmlDocumentUntil.configXml = new XmlDocument(); } XmlDocumentUntil.configXml.Load("device.xml"); //初始化所有的配置信息 //1、标题配置 title = XmlDocumentUntil.configXml.GetElementsByTagName("title")[0].InnerText; //2、通道数 channels = int.Parse(XmlDocumentUntil.configXml.GetElementsByTagName("channels")[0].InnerText); //3、显示在哪个屏幕 screen = int.Parse(XmlDocumentUntil.configXml.GetElementsByTagName("screen")[0].InnerText); cameraList = XmlDocumentUntil.getAllList(); }
private void getCramerList() { cameraList = XmlDocumentUntil.getAllList(); }