You could use something like Process.GetProcesses from System.Diagnostics;
Process[] processlist = Process.GetProcesses();
and check for the relevant process name in that list. Otherwise look at some answers of the related links to find a specific process name (ie. Tomcat).
For finding the port, this might be a little harder programatically. You might have to parse Tomcat's configuration file $CATALINA_HOME/conf/server.xml to find the ports in use. You'd be looking for something like;
<Connector port="{portNumber is here}"...
Take a look at the Tomcat documentation regarding the configuration files.