Storm33229
Knight
Windows Actions
how do I use windows actions in C#? Is there is a class for this?
how do I use windows actions in C#? Is there is a class for this?
Storm33229;651179 said:windows actions as in... uhh. like Reboot? Uhm, eject disk? Power-Off. Create account. etc.
mordero;651231 said:Like I said, check out the System.Managment namespace and see if it has anything to offer you. And you can do these things using the Windows APIs, it just takes some work...
mordero;651231 said:Like I said, check out the System.Managment namespace and see if it has anything to offer you. And you can do these things using the Windows APIs, it just takes some work...
Jeff;651240 said:Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure. Applications and services can query for interesting management information (such as how much free space is left on the disk, what is the current CPU utilization, which database a certain application is connected to, and much more), using classes derived from ManagementObjectSearcher and ManagementQuery, or subscribe to a variety of management events using the ManagementEventWatcher class. The accessible data can be from both managed and unmanaged components in the distributed environment.
System.Management Namespace
Ah, well, I basically want to write a password recovery program for my computer just incase anything ever happens.mordero;651258 said:maybe the account names (I havent looked at the link yet cause im trying to study for an exam), but not the passwords, I belive they are encrypted (or hashed) even if this namespace provided access to them, which i doubt.
Storm33229;651256 said:So you're saying I could write a simple console program using that namespace that will allow me to output all the property values of my computer? # of accounts, account names + passwords etc etc etc.
Jeff;651284 said:You can essential see and get any info from this WMI API
WMI Reference
Storm33229;651684 said:Seems like you can't use C# with Windows API's. =/ But that was just my observation. Enlighten me plz.
First result on google:Storm33229;651684 said:Seems like you can't use C# with Windows API's. =/ But that was just my observation. Enlighten me plz.
foreach( ManagementObject wmi_HD in searcher.Get() )
{
Drive d = new Drive( wmi_HD );
m_Drivetable.Add( d.Model, d );
}
public Drive( ManagementObject hdd)
{
m_BytesPerSector = ( uint )hdd["BytesPerSector"] ;
m_DeviceID = ( string )hdd["DeviceID"] ;
m_Index = ( uint )hdd["Index"] ;
m_InterfaceType = ( string )hdd["InterfaceType"] ;
m_Manufacturer = ( string )hdd["Manufacturer"] ;
m_MediaType = ( string )hdd["MediaType"] ;
m_Model = ( string )hdd["Model"] ;
m_Name = ( string )hdd["Name"] ;
m_Partitions = ( uint )hdd["Partitions"] ;
m_SectorsPerTrack = ( uint )hdd["SectorsPerTrack"] ;
m_Signature = ( uint )hdd["Signature"] ;
m_Size = ( ulong )hdd["Size"] ;
m_Status = ( string )hdd["Status"];
m_TotalCylinders = ( ulong )hdd["TotalCylinders"];
m_TotalHeads = ( uint )hdd["TotalHeads"];
m_MaxSectors = ( ulong )hdd["TotalSectors"];
m_TotalTracks = ( ulong )hdd["TotalTracks"];
}