Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
0
down vote
favorite
Is there any Win API function available to

1) query dynamic port range for TCP/UDP ?

2) exclude certain TCP/UDP port(s) in the dynamic range ?

I have found netsh command, with administrator privilege, to perform such function. Eg. "netsh int ipv4 show dynamicport tcp" for querying TCP dynamic port ragne, and "netsh int ipv4 add excludedportrange tcp 51200 1" for excluding TCP port 51200 from dynamic port range. However, I can not find any Win API function for performing that.

Thanks !

Patrick

What I have tried:

MSDN, codeproject, stackoverflow, google
Posted

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