Results 1 to 5 of 5

Thread: System informations?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234

    System informations?

    Hi,
    now to get system informations like processor type (value Mhz), available memory, processor usage, memory usage ...

    regard j

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    System.Management.Instrumentation which are wrappers around WMI classes.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Here is class I did some months back. It uses the WMI classes and assumes that WMI is installed on the client machine.
    Attached Files Attached Files

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    Thanks for answers, but how to do that with some other computer in network, and how to get memory or processor usage? What I saw, everything get only sistem informations but not currently usage.

    regard j
    Last edited by janis; May 26th, 2003 at 01:04 PM.

  5. #5
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    You want Performance Counters, and yes they can be read across a network. If you have one of the bigger version of VS .NET (I know for sure Enterprise has it, possibly the one below) then you can create a connection in Server Explorer to a target server, drill into it and see what performance counters it exposes (different OSes may not expose the same counters) and drag/drop it onto your form.

    While you don't want to rely on this for a generic utility that will be run against many different servers, it will give you a good idea of how it is done programatically - the code for initializing the counter is up in the "Windows Form Designer generated code" portion of your form's code. An example from my machine:

    VB Code:
    1. Friend WithEvents PerformanceCounter1 As System.Diagnostics.PerformanceCounter
    2.     Friend WithEvents PerformanceCounter2 As System.Diagnostics.PerformanceCounter
    3.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    4.         Me.PerformanceCounter1 = New System.Diagnostics.PerformanceCounter()
    5.         Me.PerformanceCounter2 = New System.Diagnostics.PerformanceCounter()
    6.         CType(Me.PerformanceCounter1, System.ComponentModel.ISupportInitialize).BeginInit()
    7.         CType(Me.PerformanceCounter2, System.ComponentModel.ISupportInitialize).BeginInit()
    8.         '
    9.         'PerformanceCounter1
    10.         '
    11.         Me.PerformanceCounter1.CategoryName = ".NET CLR Networking"
    12.         Me.PerformanceCounter1.CounterName = "Bytes Sent"
    13.         '
    14.         'PerformanceCounter2
    15.         '
    16.         Me.PerformanceCounter2.CategoryName = "Processor"
    17.         Me.PerformanceCounter2.CounterName = "% Processor Time"
    18.         Me.PerformanceCounter2.InstanceName = "_Total"
    19.         Me.PerformanceCounter2.MachineName = [b]"mymachinename"[/b]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width