Do you mean your local ports? You need to scan all the local ports in the set you're interested in.
Here is the code illustrating the idea:
http://social.msdn.microsoft.com/Forums/en/netfxnetcom/thread/8f0e0f22-a2d2-43f5-9909-d491297f4337[
^].
Sorry if I did not understand what did you want correctly. If you need something else, feel free to correct me and clarify your Question.
[EDIT]
I almost forgot: Don't forget to limit your activity to the set of ports allowed by the regulations of IANA.
Always be compliant with this document:
http://www.iana.org/assignments/port-numbers[
^]. Pay attention to this statement:
The Dynamic and/or Private Ports are those from 49152 through 65535.Good luck,
—SA