private void SetTcpip() { if (!RegexBase.IsIPv4(txtTCPIP.Text.ToString().Trim())) { MessageBox.Show(IniSettings.GetLanguageString("IP Address Error!", "IP地址错误!")); return; } if (!RegexBase.IsIPv4(txtTCPMask.Text.ToString().Trim())) { MessageBox.Show(IniSettings.GetLanguageString("Subnet Mask Error!", "子网掩码错误!")); return; } if (!RegexBase.IsIPv4(txtTCPGateway.Text.ToString().Trim())) { MessageBox.Show(IniSettings.GetLanguageString("GateWay Error!", "网关地址错误!")); return; } if (!RegexBase.IsMac(txtTCPMac.Text.ToString().Trim())) { MessageBox.Show(IniSettings.GetLanguageString("Mac Address Error!", "Mac地址错误!")); return; } if (!RegexBase.IsIPv4(txtRemoteIP.Text.ToString().Trim())) { MessageBox.Show(IniSettings.GetLanguageString("RemoteIP Address Error!", "RemoteIP地址错误!")); return; } TcpipParameters newTemp = GetTcpipParaInfo(); PassiveCommand.SetTcpip(SystemPub.ADRcp, newTemp.ToArray()); //if (!SystemPub.ADRcp.SendBytePkt(PassiveRcp.SetTcpip(SystemPub.ADRcp.Address, newTemp.ToArray()))) { } }