private void buttonGetDeviceID_Click(object sender, EventArgs e) { string ipaddress = kryptonComboBoxControllerIp.Text.Trim(); StringBuilder Buffer = new StringBuilder(1024); int BufferSize = 1024; string Items = "DeviceID,"; int ret = DllC0402.getDeviceParam(ipaddress, Buffer, BufferSize, Items); if (ret > 0) { textBoxControllerID.Text = Buffer.ToString().Substring(Items.Length, ret - Items.Length); toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceGetParaSucess"); } else { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceIsNotOnline"); } }
private void buttonGetMAC_Click(object sender, EventArgs e) { //MAC=00:17:61:01:88:27,IP=192.168.1.230,Mask=255.255.255.0,Gateway=192.168.1.1,DNS=192.168.1.1 string ipaddress = kryptonComboBoxControllerIp.Text.Trim(); StringBuilder Buffer = new StringBuilder(1024); int BufferSize = 1024; string Items = "MAC"; int ret = DllC0402.getDeviceParam(ipaddress, Buffer, BufferSize, Items); if (ret > 0) { int startIndex = Items.Length + 1; textBoxControllerMAC.Text = Buffer.ToString().Substring(startIndex, ret - startIndex); toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceGetParaSucess"); } else { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceIsNotOnline"); } }