System information via vb.net???????????????????????????????

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John T. Howard

    System information via vb.net???????????????????????????????

    How can I get the System Information via vb.net? At a minimum, I need
    that data supplied in Start|All Programs|Access ories|System
    Tools|System Information and, preferably the Office Applications
    subheader.

    Thanks in advance,

    John
  • Glenn Wilson

    #2
    RE: System information via vb.net????????? ??????????????? ???????

    Alot of the system information can be collected by using WMI, make a search for the system.manageme nt namespace or WM

    GW

    Comment

    • John T. Howard

      #3
      Re: System information via vb.net????????? ??????????????? ???????

      Can you explain that in simpler term, perhaps a code snippet? I'm
      pretty much of a newbie.

      Thanks,
      John

      Comment

      • Bernie Yaeger

        #4
        Re: System information via vb.net????????? ??????????????? ???????

        Hi John,

        Below code will give you so much system information that it will knock your
        socks off:
        Dim s As String = _

        Registry.LocalM achine.OpenSubK ey( _

        "SOFTWARE" _

        ).OpenSubKey( _

        "Microsoft" _

        ).OpenSubKey( _

        "Shared Tools" _

        ).OpenSubKey( _

        "MSINFO" _

        ).GetValue( _

        "Path", _

        "" _

        )

        If File.Exists(s) Then

        Process.Start(s )

        End If

        HTH,

        Bernie Yaeger

        "John T. Howard" <johnthoward100 0@comcast.net> wrote in message
        news:1ttt80ld2f 8043eesgacasf9k hnti9g0j8@4ax.c om...[color=blue]
        > How can I get the System Information via vb.net? At a minimum, I need
        > that data supplied in Start|All Programs|Access ories|System
        > Tools|System Information and, preferably the Office Applications
        > subheader.
        >
        > Thanks in advance,
        >
        > John[/color]


        Comment

        • Glenn Wilson

          #5
          Re: System information via vb.net????????? ??????????????? ???????

          Here are some information on collecting drive information through WM

          ---------------------------------------------------------------------------------
          GetDriveSerialN umber - Retrieving the serial number of the specified driv
          ' Retrieve the serial number of the specified driv
          ' Note: requires a reference to the System.Manageme nt assembl
          ' Example: MessageBox.Show (GetDriveSerial Number("D"c)

          Function GetDriveSerialN umber(ByVal driveLetter As Char) As Strin
          Dim driveFilter As String = "Win32_LogicalD isk=""" & driveLetter.ToS tring &
          ":""
          Dim drive As New System.Manageme nt.ManagementOb ject(driveFilte r
          Return drive("VolumeSe rialNumber"
          End Functio
          -----------------------------------------------------------------------------------
          GetDriveLabel - Retrieving the label of the specified driv
          ' Retrieve the drive name (label) of the specified driv
          ' Note: requires a reference to the System.Manageme nt assembl
          ' Example: MessageBox.Show (GetDriveLabel( "D"c)

          Function GetDriveLabel(B yVal driveLetter As Char) As Strin
          Dim driveFilter As String = "Win32_LogicalD isk=""" & driveLetter.ToS tring &
          ":""
          Dim drive As New System.Manageme nt.ManagementOb ject(driveFilte r
          Return drive("VolumeNa me"
          End Function

          Comment

          • Cor Ligthert

            #6
            Re: System information via vb.net????????? ??????????????? ???????

            Hi Bernie,

            Have once a look to that information path Glen gives, that will knock really
            your socks of

            :-)

            Cor


            Comment

            • Bernie Yaeger

              #7
              Re: System information via vb.net????????? ??????????????? ???????

              Hi Cor,

              I don't find the system.manageme nt namespace - am I missing something?

              Bernie

              "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
              news:ujmxtfOLEH A.1340@TK2MSFTN GP12.phx.gbl...[color=blue]
              > Hi Bernie,
              >
              > Have once a look to that information path Glen gives, that will knock[/color]
              really[color=blue]
              > your socks of
              >
              > :-)
              >
              > Cor
              >
              >[/color]


              Comment

              • Cor Ligthert

                #8
                Re: System information via vb.net????????? ??????????????? ???????

                Hi Bernie,

                It is a great namespace, you can get almost everything about a computer and
                the OS you never know before.

                With this sample you get a disk serial number I think this sample is from
                Ken (his style). However the possibilties are endless (do not forget to look
                at the link I pasted bellow).

                \\\
                Imports System.Manageme nt
                ..
                Dim disk As New ManagementObjec t("Win32_Logica lDisk.DeviceID= ""C:""")
                Dim diskProperty As PropertyData
                For Each diskProperty In disk.Properties
                Console.WriteLi ne("{0} = {1}", diskProperty.Na me, diskProperty.Va lue)
                Next diskProperty
                ///

                And see this link, than you see it even more I think.



                Success

                Cor


                Comment

                • John T. Howard

                  #9
                  Re: System information via vb.net????????? ??????????????? ???????

                  All of this is great stuff, but I don't see how to get CPU type and
                  speed, amount of physical memory, number and size of hard drives, etc.

                  Am I missing something?

                  Please keep it simple.

                  Thanks,

                  John

                  Comment

                  • Cor Ligthert

                    #10
                    Re: System information via vb.net????????? ??????????????? ???????

                    Hi John,

                    Look at the thread from Bernie, there I have put this in, however it is not
                    simple to get.

                    (When you know how it is of course simple)

                    Cor


                    Comment

                    • Bernie Yaeger

                      #11
                      Re: System information via vb.net????????? ??????????????? ???????

                      Hi Cor,

                      I believe you that it's a great namespace, but I don't have it! When I try
                      imports system. management is not a class in the namespace!

                      Bernie

                      "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                      news:ORICGFTLEH A.1612@TK2MSFTN GP12.phx.gbl...[color=blue]
                      > Hi Bernie,
                      >
                      > It is a great namespace, you can get almost everything about a computer[/color]
                      and[color=blue]
                      > the OS you never know before.
                      >
                      > With this sample you get a disk serial number I think this sample is from
                      > Ken (his style). However the possibilties are endless (do not forget to[/color]
                      look[color=blue]
                      > at the link I pasted bellow).
                      >
                      > \\\
                      > Imports System.Manageme nt
                      > .
                      > Dim disk As New ManagementObjec t("Win32_Logica lDisk.DeviceID= ""C:""")
                      > Dim diskProperty As PropertyData
                      > For Each diskProperty In disk.Properties
                      > Console.WriteLi ne("{0} = {1}", diskProperty.Na me, diskProperty.Va lue)
                      > Next diskProperty
                      > ///
                      >
                      > And see this link, than you see it even more I think.
                      >
                      >[/color]
                      http://msdn.microsoft.com/library/de...classtopic.asp[color=blue]
                      >
                      > Success
                      >
                      > Cor
                      >
                      >[/color]


                      Comment

                      • John T. Howard

                        #12
                        Re: System information via vb.net????????? ??????????????? ???????

                        Glenn:

                        When you say "Note: requires a reference to the System.Manageme nt
                        assembly" , what exactly does that mean?

                        Thanks,

                        John

                        Comment

                        • Glenn WIlson

                          #13
                          Re: System information via vb.net????????? ??????????????? ???????

                          Go to the referances section of you project and sellect add referance, then add the system.manageme nt.dll, this will allow you to use WMI

                          Comment

                          • Cor Ligthert

                            #14
                            Re: System information via vb.net????????? ??????????????? ???????

                            Hi Oops,

                            Sorry Bernie, I thought you know this or is there something else wrong.

                            You have to set a reference to System.Manageme nt for it.

                            Cor


                            Comment

                            Working...