private void buttonSetMask_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(); string Items = "Mask=" + textBoxControllerSubnetMask.Text.Trim(); int ret = DllC0402.setDeviceParam(ipaddress, Items); if (ret == 0) { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceSetParaSucess"); } else { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceIsNotOnline"); } }
private void buttonSetDeviceID_Click(object sender, EventArgs e) { string ipaddress = kryptonComboBoxControllerIp.Text.Trim(); string DeviceID = "DeviceID=" + textBoxControllerID.Text.Trim(); int ret = DllC0402.setDeviceParam(ipaddress, DeviceID); if (ret == 0) { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceSetParaSucess"); } else { toolStripStatusLabel2.Text = MyMessageBox.getStringFromRes("textDeviceIsNotOnline"); } }
private void buttonSynchronizeTime_Click(object sender, EventArgs e) { string ipaddress = kryptonComboBoxControllerIp.Text.Trim(); string deviceDate = "DeviceDate=" + DateTime.Now.Date.ToShortDateString() + ","; string deviceTime = "DeviceTime=" + DateTime.Now.ToLongTimeString(); string deviceDateTime = deviceDate + deviceTime; int ret = DllC0402.setDeviceParam(ipaddress, deviceDateTime); if (ret == 0) { MyMessageBox.MessageBoxOK("textDeviceSetParaSucess"); } else { MyMessageBox.MessageBoxOK("textDeviceIsNotOnline"); } }