Okay well I have gotten the code at the bottom to work but only for the Web server it is installed on, which is also the domain controller. I haven't been able to get it to give any information on any other machine.
When I try I get the following:
Exception Details: System.ComponentModel.Win32Exception: Access is denied
I had to set up permission for the ASPNET user to be able to read the perflib registry key. But it only seems to work for the local machine and not any domain machine.
Can someone please help me solve this issue.
<%@ Import Namespace = System.Diagnostics %>
void Page_Load( Object Src, EventArgs E )
PerformanceCounter perfFreeMem = new PerformanceCounter( "Memory", "Available MBytes", "", "Arena3" );
lblFreeMem.Text = perfFreeMem.NextValue().ToString();
<asp:Label id="lblAppRestarts" runat="server"></asp:Label>
Free Memory (in MB):
<asp:Label id="lblFreeMem" runat="server"></asp:Label>