Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SysInfo - .Net counterpart?

Status
Not open for further replies.

bigtimmin

MIS
Apr 12, 2005
125
US
I am looking for the .Net equivalent to SysInfo. I need to get device arrivals/removals (when a device is added/removed, when a new media is place in a cd/removable drive). When the power status changes to/from AC/Battery. SysInfo provided quite a bit more, but if someone can point me along those lines.
Thanks!

Maybe this world is another planet’s Hell.
Aldous Huxley

eyes_015.gif___1129027102664
eyes_015.gif___1129027102664
 
I am not at a place where I can reach .net now. But I think it is
[tt]My.Computer.____[/tt]

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
FYI: I have found two system.events that replaces most of the functionality in AxSysinfo:
Code:
[COLOR=blue]Imports[/color] Microsoft.Win32
    [COLOR=blue]Private Sub[/color] HookEventsAdd()
        [COLOR=blue]AddHandler[/color] SystemEvents.UserPreferenceChanged, [COLOR=blue]AddressOf[/color] UserPreferenceChanged
        [COLOR=blue]AddHandler[/color] SystemEvents.PowerModeChanged, [COLOR=blue]AddressOf[/color] PowerModeChanged
    [COLOR=blue]End Sub

    Private Sub [/color]HookEventsRemove()
        [COLOR=blue]RemoveHandler[/color] SystemEvents.UserPreferenceChanged, [COLOR=blue]AddressOf[/color] UserPreferenceChanged
        [COLOR=blue]RemoveHandler[/color] SystemEvents.PowerModeChanged, [COLOR=blue]AddressOf[/color] PowerModeChanged
    [COLOR=blue]End Sub

    Private Sub [/color]PowerModeChanged([COLOR=blue]ByVal[/color] sender [COLOR=blue]As[/color] System.Object, [COLOR=blue]ByVal[/color] e [COLOR=blue]As[/color] PowerModeChangedEventArgs)
        [COLOR=blue]Select Case[/color] e.Mode
            [i]blahblahblah[/i]
        [COLOR=blue]End Select
    End Sub

    Private Sub[/color] UserPreferenceChanged([COLOR=blue]ByVal[/color] sender [COLOR=blue]As[/color] System.Object, [COLOR=blue]ByVal[/color] e [COLOR=blue]As[/color] UserPreferenceChangedEventArgs)
        [COLOR=blue]Select Case[/color] e.Category
            [i]blahblahblah[/i]
        [COLOR=blue]End Select
    End Sub
Just run HookEventsAdd during load and the HookEventsRemove during closing.

Now if I can just find DeviceArrivals & DeviceRemoval (media being inserted/ejected) w/o using API/WMI, I can remove the SysInfo DLL from my project. Does any know how to do this???

Maybe this world is another planet’s Hell.
Aldous Huxley

eyes_015.gif___1129027102664
eyes_015.gif___1129027102664
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top