<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Determine Windows Version and Edition with C#</title>
	<atom:link href="http://www.csharp411.com/determine-windows-version-and-edition-with-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Tue, 07 Sep 2010 15:50:57 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John Guy</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5660</link>
		<dc:creator>John Guy</dc:creator>
		<pubDate>Fri, 03 Sep 2010 18:56:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5660</guid>
		<description>It looks a little weird I do agree - but if I do not trap it like this the code returns Windows 2003 Server 64-bit. My XP SP2 64-bit reports the build as  5.2.3790.131072</description>
		<content:encoded><![CDATA[<p>It looks a little weird I do agree &#8211; but if I do not trap it like this the code returns Windows 2003 Server 64-bit. My XP SP2 64-bit reports the build as  5.2.3790.131072</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MZ</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5659</link>
		<dc:creator>MZ</dc:creator>
		<pubDate>Fri, 03 Sep 2010 12:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5659</guid>
		<description>this doesn&#039;t work. it tells u the platform (64/32 bit) of code that runs the context. not the undelying os.</description>
		<content:encoded><![CDATA[<p>this doesn't work. it tells u the platform (64/32 bit) of code that runs the context. not the undelying os.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Guy</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5596</link>
		<dc:creator>John Guy</dc:creator>
		<pubDate>Fri, 23 Jul 2010 15:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5596</guid>
		<description>To cope with XP 64-bit I made this change in
#region 2000, XP, 2003 
case 5:
switch (minorVersion)
 
case 2: 
if (productType == VER_NT_WORKSTATION)
  name = &quot;Windows XP&quot;;  // handles XP 64-bit
else
  name = &quot;Windows Server 2003&quot;;
break;</description>
		<content:encoded><![CDATA[<p>To cope with XP 64-bit I made this change in<br />
#region 2000, XP, 2003<br />
case 5:<br />
switch (minorVersion)</p>
<p>case 2:<br />
if (productType == VER_NT_WORKSTATION)<br />
  name = "Windows XP";  // handles XP 64-bit<br />
else<br />
  name = "Windows Server 2003&#8243;;<br />
break;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SP1K</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5468</link>
		<dc:creator>SP1K</dc:creator>
		<pubDate>Fri, 30 Apr 2010 17:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5468</guid>
		<description>Can you send me an email at the email I posted.  Thank you.</description>
		<content:encoded><![CDATA[<p>Can you send me an email at the email I posted.  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5467</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 30 Apr 2010 17:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5467</guid>
		<description>@SP1K: For some reason your program is lacking a Main method:

[STAThread]
static void Main()
{
   // start your program here
}</description>
		<content:encoded><![CDATA[<p>@SP1K: For some reason your program is lacking a Main method:</p>
<p>[STAThread]<br />
static void Main()<br />
{<br />
   // start your program here<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SP1K</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5466</link>
		<dc:creator>SP1K</dc:creator>
		<pubDate>Fri, 30 Apr 2010 16:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5466</guid>
		<description>+ I opened VS2010.
+ I Created new C# Console Project in .NF 2.0
+ I Copied the code above and pasted it into the Code after deleting the premade VS code.
+ Set it to Release mode.
+ Compiled and got this error:
------------------------------------------------------
Error	1	Program &#039;c:\users\owner\documents\visual studio 2010\Projects\OSCheck-Console\OSCheck-Console\obj\x86\Release\OSCheck-Console.exe&#039; does not contain a static &#039;Main&#039; method suitable for an entry point	OSCheck-Console
------------------------------------------------------

What did I do wrong?</description>
		<content:encoded><![CDATA[<p>+ I opened VS2010.<br />
+ I Created new C# Console Project in .NF 2.0<br />
+ I Copied the code above and pasted it into the Code after deleting the premade VS code.<br />
+ Set it to Release mode.<br />
+ Compiled and got this error:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Error	1	Program 'c:\users\owner\documents\visual studio 2010\Projects\OSCheck-Console\OSCheck-Console\obj\x86\Release\OSCheck-Console.exe' does not contain a static 'Main' method suitable for an entry point	OSCheck-Console<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>What did I do wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wierdbeard65</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5426</link>
		<dc:creator>Wierdbeard65</dc:creator>
		<pubDate>Sun, 11 Apr 2010 11:43:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5426</guid>
		<description>Awsome!

Ok, I&#039;m devloping using W7 64-bit, but my app needs to run on both 32 and 64 bit. No problem so far, except I&#039;m using SQLite3. There are two different DLLs depending on the OS version. So, how can I use the detection code to dynamically select which version of the DLL to load?</description>
		<content:encoded><![CDATA[<p>Awsome!</p>
<p>Ok, I'm devloping using W7 64-bit, but my app needs to run on both 32 and 64 bit. No problem so far, except I'm using SQLite3. There are two different DLLs depending on the OS version. So, how can I use the detection code to dynamically select which version of the DLL to load?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Guy</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5374</link>
		<dc:creator>John Guy</dc:creator>
		<pubDate>Tue, 02 Feb 2010 19:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5374</guid>
		<description>Ok I have found it!!  
To discriminate if you have a Tablet PC running XP

Inside #region EDITION I added

[DLLImport(&quot;user32&quot;)]
public static extern int GetSystemMetrics(int nIndex);

and 

in #region 5 made this change

if ((suitMask &amp; VER_SUITE_PERSONAL) != 0)
{
  edition = &quot;Home&quot;;
}
else
{
   if (GetSystemMetrics(86) == 0) // 86 == SM_TABLETPC
     edition = &quot;Professional&quot;;        
   else
     edition = &quot;Tablet Edition&quot;;
}

I was able to test only on an XP Tablet and an XP Professional laptops.
Thanks for a terrific article and Jonney Tiney fb.</description>
		<content:encoded><![CDATA[<p>Ok I have found it!!<br />
To discriminate if you have a Tablet PC running XP</p>
<p>Inside #region EDITION I added</p>
<p>[DLLImport("user32")]<br />
public static extern int GetSystemMetrics(int nIndex);</p>
<p>and </p>
<p>in #region 5 made this change</p>
<p>if ((suitMask &amp; VER_SUITE_PERSONAL) != 0)<br />
{<br />
  edition = "Home";<br />
}<br />
else<br />
{<br />
   if (GetSystemMetrics(86) == 0) // 86 == SM_TABLETPC<br />
     edition = "Professional";<br />
   else<br />
     edition = "Tablet Edition";<br />
}</p>
<p>I was able to test only on an XP Tablet and an XP Professional laptops.<br />
Thanks for a terrific article and Jonney Tiney fb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5373</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 02 Feb 2010 18:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5373</guid>
		<description>Have you a way of discriminating between XP Professional and XP Tablet?</description>
		<content:encoded><![CDATA[<p>Have you a way of discriminating between XP Professional and XP Tablet?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonny Tiney</title>
		<link>http://www.csharp411.com/determine-windows-version-and-edition-with-c/comment-page-1/#comment-5347</link>
		<dc:creator>Jonny Tiney</dc:creator>
		<pubDate>Wed, 23 Dec 2009 14:48:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/determine-windows-version-and-edition-with-c/#comment-5347</guid>
		<description>Hi, thanks for this - Works a treat for Operating System&#039;s up to Vista. For it to detect Windows 7, I amended the Windows Vista Detection to look like this:

case 6:
switch (minorVersion)
{
   case 0:
   name = &quot;Windows Vista&quot;;
   break;

   case 1:
   name = &quot;Windows 7&quot;;
   break;

   case 3:
   name = &quot;Windows Server 2008&quot;;
   break;
}
break;

Seems to work a treat, but haven&#039;t tested on Windows Vista. I now want to know how I would go about fixing the Product part, so it will show &#039;Professional&#039; etc. (I think Home Premium, Basic and Ultimate should still be working).

Any help is appreciated :-D</description>
		<content:encoded><![CDATA[<p>Hi, thanks for this &#8211; Works a treat for Operating System's up to Vista. For it to detect Windows 7, I amended the Windows Vista Detection to look like this:</p>
<p>case 6:<br />
switch (minorVersion)<br />
{<br />
   case 0:<br />
   name = "Windows Vista";<br />
   break;</p>
<p>   case 1:<br />
   name = "Windows 7&#8243;;<br />
   break;</p>
<p>   case 3:<br />
   name = "Windows Server 2008&#8243;;<br />
   break;<br />
}<br />
break;</p>
<p>Seems to work a treat, but haven't tested on Windows Vista. I now want to know how I would go about fixing the Product part, so it will show 'Professional' etc. (I think Home Premium, Basic and Ultimate should still be working).</p>
<p>Any help is appreciated <img src='http://www.csharp411.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
