How do you get the available memory on a web server?

I want to be able to get the available memory on a web server, by going to the page in asp.net and displaying the value. I want to be able to test under WindowsXP before moving it to production, so any help on this would be appreciated. Thanks.
JDEE8297Asked:
Who is Participating?
 
daveamourConnect With a Mentor Commented:
0
 
JDEE8297Author Commented:
that should work, not totally familiar with csharp, but should be able to convert this to vb.net
0
 
daveamourCommented:
Ok good luck
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
JDEE8297Author Commented:
thank you again.
0
 
JDEE8297Author Commented:
This was my conversion

 Dim ram As New System.Diagnostics.PerformanceCounter("Memory", "Available MBytes")
        dim cpu as New System.Diagnostics.PerformanceCounter()

        cpu.CategoryName = "Processor"
        cpu.CounterName = "% Processor Time"
        cpu.InstanceName = "_Total"
        Response.Write("Server Name - " & Environment.MachineName)
        Response.Write("<br>")
        Response.Write("Memory available - " & ram.NextValue().ToString & " Mb")
        Response.Write("<br>")
        response.Write ("CPU Used - " & cpu.NextValue().ToString & " %")

Thanks again for your help.
0
 
daveamourCommented:
Looks nice and easy, nice one.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.