[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Programmatically get the Service Pack version?

Ever Olano

7/19/2002 5:48:00 PM

Hi. I can programmatically get the platform and the
version of the OS. Is there a way to also get any Service
Pack information?

Thanks,
Ever
3 Answers

Mattias Sjögren

7/19/2002 6:26:00 PM

0

Ever,

>I can programmatically get the platform and the
>version of the OS. Is there a way to also get any Service
>Pack information?

Only through PInvoke.

HOWTO: Determine Operating System Service Pack Level in Visual C# .NET
http://support.microsoft.com/default.aspx?scid=k...

HOWTO: Determine OS Service Pack Level in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=k...


Mattias

==Mattias Sjögren (VB MVP)
mattias @ mvps.org
http://www.msjogren.n...

Ever Olano

7/19/2002 7:03:00 PM

0

That's good enough. I'm using PInvoke anyway to do other
stuff. ;)

Thanks!

>-----Original Message-----
>Ever,
>
>>I can programmatically get the platform and the
>>version of the OS. Is there a way to also get any
Service
>>Pack information?
>
>Only through PInvoke.
>
>HOWTO: Determine Operating System Service Pack Level in
Visual C# .NET
>http://support.microsoft.com/default.aspx?scid=k...
>
>HOWTO: Determine OS Service Pack Level in Visual
Basic .NET
>http://support.microsoft.com/default.aspx?scid=k...
>
>
>Mattias
>
>===
>Mattias Sjögren (VB MVP)
>mattias @ mvps.org
>http://www.msjogren.n...
>.
>

Willy Denoyette [MVP]

7/20/2002 10:47:00 AM

0

Use the System.Management namespace classes and WMI.

<C# snippet>
...
SelectQuery query = new SelectQuery("Win32_OperatingSystem");
ManagementObjectSearcher searcher = new ManagementObjectSearcher( query);
foreach (ManagementObject mo in searcher.Get())
Console.WriteLine("OS Version: {0} - SP {1} ",
mo["Version"].ToString(),mo["ServicePackMajorVersion"].ToString()) ;
}
....

Willy.

"Ever Olano" <ever@nospam.com> wrote in message news:177c701c22f3b$b8ed2380$a5e62ecf@tkmsftngxa07...
> Hi. I can programmatically get the platform and the
> version of the OS. Is there a way to also get any Service
> Pack information?
>
> Thanks,
> Ever