PC Review


Reply
Thread Tools Rate Thread

COM Port Delete

 
 
M. Meganathan
Guest
Posts: n/a
 
      4th Jun 2009
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.




 
Reply With Quote
 
 
 
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      5th Jun 2009
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

"M. Meganathan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete TCP/IP port komobu Windows XP General 2 19th Apr 2006 05:01 PM
Cannot delete a port =?Utf-8?B?eGNvYWNo?= Windows XP Print / Fax 4 27th May 2005 08:49 PM
Cannot delete Printer port - D-Link LPT port SM Windows XP Print / Fax 1 1st Jul 2004 01:43 AM
DLINK DP-300U Port Setup Problems -- can not delete port Dave Windows XP Print / Fax 1 20th Apr 2004 07:38 PM
Re: Can't Delete Port Alan Morris\(MSFT\) Microsoft Windows 2000 Printing 1 7th Apr 2004 03:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:25 PM.