closing a port with vb.NET

frix199

Member
Joined
Jul 18, 2005
Messages
19
Programming Experience
1-3
hello there, i got a question...
how can vb.NET close a specific port?

like, by pressing a button close the port 3056?

help plzzz
 
What is the idea? What is the kind of app you are working on? However, you can close that port if you close the current app that has reserved that port for itsself. with other words, using the same process that opens it. Otherwise, you need to call the CloseHandle( ) WINAPI to close a serial port so, if you are familiar with API it could be adequate solution for your problem.

Regards ;)
 
Well, 1st off, you cannot 'reserve' a port if you process is not running but, if your program open up the port first, other program will not be able to access it anymore. So, it is best if you run your app and get the port/s on startup before other programs do.

Moreover, you can check which process is fighting with your application for the port ownership. Thenm you can either remove the program or load yours in advance.


Regards ;)
 
Back
Top