COM Port Delete


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.
 
Ad

Advertisements

P

Peter Foot [MVP]

There isn't really much context in the code to know where you are making
these changes - is this a Bluetooth COM port?

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top