|
||
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
What do you mean by Windows actions?
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
You might be able to use the System.Management namespace for some of that (just found that on a quick google search) but you can also do all of that using PInvoke and the Window APIs. Just search google for code on how to do some of that stuff...
A useful website if you start using the APIs pinvoke.net: the interop wiki!
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#5 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Quote:
![]()
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#6 (permalink) | |
|
Forum Expert
|
well it's probably not as simple as creating a new instance of an account and defining specific variables belonging to it... but it has got to be possible to do it somehow. and I am figuring C# has a class to do it, just do not know how.
__________________
Quote:
|
|
|
|
|
|
|
#7 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
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...
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#9 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Quote:
![]()
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#10 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Lol ok, so dont use System.Management haha
(I didnt even know about it until I searched for restarting a comp in c# on google)
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#11 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
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
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
#12 (permalink) | ||
|
Forum Expert
|
Quote:
__________________
Quote:
|
||
|
|
|
|
|
#13 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
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.
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial Last edited by mordero; 02-12-2007 at 02:19 PM. |
|
|
|
|
|
#15 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Hmmm, well google is your friend.
Also, Im now pretty sure the passwords are encrypted, not hashed because there are programs out there that will crack them for you (although if they use brute force, then they could be hashed).
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#16 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Quote:
WMI Reference
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#17 (permalink) | ||
|
Forum Expert
|
Quote:
__________________
Quote:
|
||
|
|
|
|
|
#18 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Quote:
look for System.Management stuff, you use it like a database. Ill look for old code.
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#19 (permalink) | |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Quote:
C# And API's You can find almost anything if you just search for it. and pinvoke.net: the interop wiki! will help with that...
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
|
#20 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
Example of how I used that namespace, before FileSystem.GetDrives() worked
. Not to mention the amount of info u can get out of these objects.Code:
foreach( ManagementObject wmi_HD in searcher.Get() )
{
Drive d = new Drive( wmi_HD );
m_Drivetable.Add( d.Model, d );
}
Code:
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"];
}
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
#21 (permalink) |
|
Forum Expert
|
If you want do simple stuff like reboot the computer, Why don't you just get C# to run a BAT file? That would be the simple way...
Although, you won't be able to find any info about the computer (e.g. drives) unless you crack into the WMI as Jeff and Mordero says.
__________________
Use the middle mouse button on Here for forum rules, if nothing happens get firefox and try again!!! |
|
|
|
|
|
#22 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Age: 28
Posts: 4,886
|
pinvoke.net: WTSShutdownSystem (wtsapi32)
pinvoke.net: CM_Request_Device_Eject (setupapi) pinvoke.net: InitiateSystemShutdown (advapi32) pinvoke.net: CredWrite (advapi32) Just a few all on that page tho.
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
#23 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
*loves pinvoke.net*
*loves google*
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|