Re: OperatingSystem Class for Remote Computer,...



Hi urkec,

no, i wont use WMI, i just want to stay at Registry Information.
I solved this by writing that class, but i dont know how this will
work on vista, because i tested it only on 2000 up to XP. It works
fine, but i dont know how vista will provide the registry information:

//CODE

public class OperatingSystemEx {

private string machineName;

private Version version;

private PlatformID platformId;

public OperatingSystemEx(string TargetMachine){

this.machineName = TargetMachine;

try

{

this.platformId = PlatformID.Win32NT;

try

{

string VersionString = (string)
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
TargetMachine).OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion",
false).GetValue("CurrentVersion", "0.0");

if (VersionString != "0.0")

{

int Major = Convert.ToInt32(VersionString.Substring(0, 1));

int Minor = Convert.ToInt32(VersionString.Substring(2, 1));

this.version = new Version(Major, Minor);

}

}

catch (Exception)

{

this.version = new Version(Environment.OSVersion.VersionString);

}

}

catch (Exception)

{

this.platformId = PlatformID.Win32NT;

this.version = new Version(Environment.OSVersion.VersionString);

}

}


public System.Version Version{

get{ return this.version; }

}

public System.PlatformID Platform {

get { return this.platformId; }

}

}


//END CODE

WMI is sometimes really slow, so i wont work with it. This solution is
good, but i dont know whether it works on vista. Can you check it, if
you have vista running please and tell me what wont work if it does not,..

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"urkec" <urkec@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:057FA60F-969F-40EB-BC17-9513BB2D9F07@xxxxxxxxxxxxxxxx
"Kerem Gümrükcü" wrote:

Hi,

is it possible to get the Information that comes from OperatingSystem
Class
from a Remote Comupter. Is there a remote information supporting
OperatingSystem
Class or can i get this information another way, e.g. from opening remote
registry?
The target Systems are strictly Windows.


Thanks in Advance,...


Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."




I think you usuallu use WMI for getting that kind of information remotely.
Have you considered Win32_OperatingSystem?


--
urkec


.



Relevant Pages

  • Re: Flatland and Koxx-one
    ... basically an all-around unicycle. ... I personally have never had a problem with a frame design like ... I wont comment on the fitting of different ISIS parts. ... Im also bad with flatland trick knowledge, and I dont see why Koxx is ...
    (rec.sport.unicycling)
  • Re: XT 250 wont stay ideling, needs choke full open, PLEASE reply SOON
    ... and then she wont stay going. ... As well I dont know about the gears this is ... I would still lean to a carb or at least gas problem. ... If it isn't clipped in place the high speed jets will open too soon/wrong when you open the throttle. ...
    (rec.motorcycles.tech)
  • Im BACK!
    ... Well most of you probably wont remember me anyway, ... I figure with Stremme ... #2 Driver is Nemecheck ... If anyone else comes in first I really dont care. ...
    (rec.autos.sport.nascar)
  • Re: what should i do?
    ... Dude, calm blue ocean calm blue ocean.... ... that wont be seen... ... DONT: Jump in too far too hard and too deep or you "will" get swamped... ...
    (comp.graphics.apps.lightwave)
  • Understanding WMI coding
    ... I am having problem understanding all the coding when WMI gets mixed into ... I dont understand why or how the variable.functionworks, ... just reading code finding the lines that I need to to make somthign work ...
    (microsoft.public.windows.server.scripting)