Menu
Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
COM Port Delete
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="M. Meganathan" data-source="post: 13284754"><p>Hi,</p><p></p><p>How to delete com port in Device</p><p></p><p>I can able delete com port but it is not reflected in device</p><p></p><p>Please help this issue</p><p></p><p>Code:</p><p></p><p>//Registry to open sub key</p><p></p><p>Microsoft.Win32.RegistryKey rkDevice = rkPorts.OpenSubKey(deviceid);</p><p></p><p></p><p>//remove port from arraylist if unavailable</p><p></p><p>string port = rkDevice.GetValue("Port").ToString();</p><p></p><p>int nullPos = port.IndexOf('\0');</p><p></p><p></p><p>if (nullPos > -1)</p><p></p><p>{</p><p></p><p>port = port.Substring(0, nullPos);</p><p></p><p>}</p><p></p><p>//Delete Exiting Com Port</p><p></p><p>if (alPorts.Contains(port))</p><p></p><p>{</p><p></p><p>alPorts.Remove(port);</p><p></p><p>}</p><p></p><p></p><p>//Close Com Devices</p><p></p><p>rkDevice.Close();</p><p></p><p></p><p></p><p>Any Wrong above code.</p></blockquote><p></p>
[QUOTE="M. Meganathan, post: 13284754"] 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. [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
COM Port Delete
Top