how to find list of open port and close open port in vb.net.

commented: Not really a help question. You should show the code where you stick on. Else we assume, you asking us for writing your code. -2

What types of ports are you looking at finding ? Serial ?

which type of port are most attacked by website or hacker?
program is to prevent open port attack by hacker.

I don't want to be rude but based on the questions you ask'd I have some doubts you have the knowledge (of coding and understanding) to prevent any hacker from hacking.
I am really sorry but securing a computer needs knowledge about computer structures and ofc coding.
/me is takes the down vote ;)

Well your question is not straight you just need to understand first how hacking is done and also understand the structure of the computer, you sound like you don't even know what you are talking about, the hacker can hack a system in many different ways, you can try to close the ports but if the system is not secured enough the hacker can crack it and reopen the port because you don't know how to put strong security and there is no one who will write that code for you, I suggest you do your research in advance before attempting to create this.