You can use CurrPorts, to display a list of all currently opened TCP/IP and UDP ports on your local computer. It is a portable program and doesn't need to be installed.
For each port that CurrPorts lists, information about the process that opened the port is displayed. You can select connections and close them, copy a port's information to the clipboard or save it to an HTML file, an XML file, or a tab-delimited text file.
You can reorder the columns displayed on the CurrPorts main window and in the files you save. To sort the list by a specific column, simply click on the header of that column.