M
M. Meganathan
Hi,
How to delete com port in Device
I can able delete com port but it is not reflected in device
Please help this issue
Code:
//Registry to open sub key
Microsoft.Win32.RegistryKey rkDevice = rkPorts.OpenSubKey(deviceid);
//remove port from arraylist if unavailable
string port = rkDevice.GetValue("Port").ToString();
int nullPos = port.IndexOf('\0');
if (nullPos > -1)
{
port = port.Substring(0, nullPos);
}
//Delete Exiting Com Port
if (alPorts.Contains(port))
{
alPorts.Remove(port);
}
//Close Com Devices
rkDevice.Close();
Any Wrong above code.
How to delete com port in Device
I can able delete com port but it is not reflected in device
Please help this issue
Code:
//Registry to open sub key
Microsoft.Win32.RegistryKey rkDevice = rkPorts.OpenSubKey(deviceid);
//remove port from arraylist if unavailable
string port = rkDevice.GetValue("Port").ToString();
int nullPos = port.IndexOf('\0');
if (nullPos > -1)
{
port = port.Substring(0, nullPos);
}
//Delete Exiting Com Port
if (alPorts.Contains(port))
{
alPorts.Remove(port);
}
//Close Com Devices
rkDevice.Close();
Any Wrong above code.