Re: OperatingSystem Class for Remote Computer,...
- From: "Kerem Gümrükcü" <kareem114@xxxxxxxxxxx>
- Date: Sat, 14 Jun 2008 21:52:30 +0200
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
.
- References:
- OperatingSystem Class for Remote Computer,...
- From: Kerem Gümrükcü
- OperatingSystem Class for Remote Computer,...
- Prev by Date: Decimal to Word
- Next by Date: Recursive Reading
- Previous by thread: OperatingSystem Class for Remote Computer,...
- Next by thread: Re: OperatingSystem Class for Remote Computer,...
- Index(es):
Relevant Pages
|
|