Click here to Skip to main content
15,891,764 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
How can I change name of Serial Port using C#

Say My System have COM1
I want to rename it to COM2

Is it possible ?

How ?

I googled but could not find relevant


Thanks in Advance


:-D
Posted

1 solution

COM ports are associated with specific interrupts:

COM1 IRQ4 3F8H
COM2 IRQ3 2F8H
COM3 IRQ4 3E8H
COM4 IRQ3 2E8H


The only way you can "rename" the ports in C# is by changing the name of the object that represents that port. Keep in mind that this is a patently BAD idea, because the object doesn't accurately represent the underlying hardware.

 
Share this answer
 
Comments
fjdiewornncalwe 25-Dec-10 19:14pm    
Perfect... (The answer, not the concept)
Roger Wright 27-Dec-10 1:05am    
Exactly correct. COM ports are system devices, not for users to change. If, for some reason, another name is required for an app, the underlying COM port can be encapsulated by a user object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900