<p>I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that #xx index. Is there a programmatic way (from an ASP.NET web page)?</p>

The first hit on Google:
Multiple CLR performance counters appear that have names that resemble "W3wp#1"
When multiple ASP.NET worker processes
  are running, Common Language Runtime
  (CLR) performance counters will have
  names that resemble "W3wp#1" or
  "W3sp#2"and so on. This was remedied
  in .NET Framework 2.0 to include a
  counter named Process ID in the .NET
  CLR Memory performance object. This
  counter displays the process ID for an
  instance. You can use this counter to
  determine the CLR performance counter
  that is associated with a process.
Also
KB 281884
:
By default, Performance Monitor
  (Perfmon.msc) displays multiple
  processes that have the same name by
  enumerating the processes in the
  following way:
Process#1 Process#2 Process#3
Performance Monitor can also display
  these processes by appending the
  process ID (PID) to the name in the
  following way:
Process_PID