private void btnSet_Click(object sender, EventArgs e) { try { if (CheckInput()) { DeviceInfo info = GetDeviceInfoFromInput(); if (UpdatingEntrance.SetParkNum(info.DeviceNum)) { MessageBox.Show("硬件参数设置成功"); } else { MessageBox.Show("硬件参数设置失败"); } LANInfo li = GetLANInfoFromInput(); if (UpdatingEntrance.SetLANInfo(li)) { MessageBox.Show("LAN参数设置成功"); } else { MessageBox.Show("LAN参数设置失败"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ShowLANInfo(LANInfo info) { this.Text = info.IPAddress; txtIPAddress.IP = info.IPAddress; txtIPMask.IP = info.IPMask; txtGateWay.IP = info.GateWay; }
/// <summary> /// Parse room name, ip address, and add a button to our room list /// </summary> /// <param name="rawAddress"></param> /// <param name="data"></param> public override void OnReceivedBroadcast(string rawAddress, string data) { base.OnReceivedBroadcast(rawAddress, data); //::ffff:192.168.0.4 this is a rawAddress value int ipStart = rawAddress.LastIndexOf(':') + 1; string cleanAddress = rawAddress.Substring(ipStart); for (int i = 0; i < lanAddresses.Count; i++) { if (lanAddresses[i].ipAddress == cleanAddress) { lanAddresses[i].removeAtTime = Time.time + timeout; return; } } GameObject button = TitleUIManager.HostJoinRoomMenu.AddRoom(data); LANInfo info = new LANInfo() { removeAtTime = Time.time + timeout, ipAddress = cleanAddress, roomButton = button, roomName = data }; lanAddresses.Add(info); }
private void ShowLANInfo(LANInfo info) { this.Text = info.IPAddress; txtIP.IP = info.IPAddress; txtIP.Enabled = false; txtIPMask.IP = info.IPMask; txtIPMask.Enabled = false; txtGateWay.IP = info.GateWay; txtGateWay.Enabled = false; }
private LANInfo GetLANInfoFromInput() { LANInfo info = new LANInfo(); info.IPAddress = txtIPAddress.IP; info.IPMask = txtIPMask.IP; info.GateWay = txtGateWay.IP; info.ControlPort = 4001; info.EventPort = 5001; return(info); }
private void ShowLANInfo(LANInfo info) { this.Text = info.IPAddress; txtIP.IP = info.IPAddress; txtIP.Enabled = false; txtIPMask.IP = info.IPMask; txtIPMask.Enabled = false; txtGateWay.IP = info.GateWay; txtGateWay.Enabled = false; this.txtControlPort.Text = info.ControlPort.ToString(); this.txtEventPort.Text = info.EventPort.ToString(); }
private LANInfo GetLANInfoFromInput() { LANInfo info = new LANInfo(); info.IPAddress = txtIPAddress.IP; info.IPMask = txtIPMask.IP; info.GateWay = txtGateWay.IP; info.MasterIP = txtMasterIP.IP; info.EventListenerIP = txtEventListenerIP.IP; info.EventListenerPort = int.Parse(listenerPort.Text); info.MACAddress = this.txtmac.Text; return(info); }
private void ShowLANInfo(LANInfo info) { this.Text = info.IPAddress; txtIPAddress.IP = info.IPAddress; txtIPMask.IP = info.IPMask; txtGateWay.IP = info.GateWay; txtMasterIP.IP = info.MasterIP; txtEventListenerIP.IP = info.EventListenerIP; this.txtmac.Text = info.MACAddress; this.controlPort.Text = info.ControlPort.ToString(); this.eventPort.Text = info.EventPort.ToString(); this.listenerPort.Text = info.EventListenerPort.ToString(); }
private void btnGetHardwareInfo_Click(object sender, EventArgs e) { if (UpdatingItem != null) { EntranceInfo entrance = UpdatingItem as EntranceInfo; FrmParkDeviceDetail frm = new FrmParkDeviceDetail(); LANInfo lan = new LANInfo() { IPAddress = entrance.IPAddress, IPMask = entrance.IPMask, GateWay = entrance.Gateway, ControlPort = entrance.ControlPort, }; ParkDevice pd = new Hardware.ParkDevice(lan); frm.TopMost = true; frm.UpdatingEntrance = pd; frm.Show(); } }
private void btnSet_Click(object sender, EventArgs e) { try { LANInfo li = GetLANInfoFromInput(); if (UpdatingDevice.SetLANInfo(li)) { MessageBox.Show(Resources.Resource1.FrmParkDeviceDetail_SetLanSuccess); } else { MessageBox.Show(Resources.Resource1.FrmParkDeviceDetail_SetLanFail); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }