You will need to find the value called MAXCONNECTIONS. It may not actually exists, in which case you need to add it, its a string value. Set the value to the number you worked out earlier and no more.
For NT /W2k:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
You are looking for the MAXUSERPORT value this time, it *should* already be there, if not, add it. The values is a DWORD and should be set to the number you worked out. Be sure to take into account any other services you are running when you set this.
You will need to restart for these changes to take effect. For safety sake, you can export the keys you are altering before you make the change, then if things dont work out, a quick double click on the .reg file you exported and a reboot restores your system. (不要告诉我瞧不明白):