Verifying OS

billy_bob169

Freshman
Joined
Jan 30, 2003
Messages
32
Location
Minnesota
Is there a way, in VB.NET, to check what operating system the user is running. I have run into a problem with the printpreview control when my program is running on Win 98. I can get around the problem by just printing the document (no preview), but what would be the fun in that. Here is what I am trying to accomplish...if the user is running Win 98 or Win ME, I want the print preview option in my Menu to be disabled, leaving only the option to print. That way if they are running a newer OS, the option to preview it will be there. Is this possible???
 
Visual Basic:
If Environment.OSVersion.Platform = PlatformID.Win32Windows Then
    'They're on 98 or ME
End If

You could use this at any time to disable that menu option.
 
Seems to work beautifully! Thanks again Divil. Is this all stuff that you just know "off the top of your head"? Or is there a reference point (other than this forum) that I can search so I don't have to bug everyone with such simple questions!
 
I guess I learned it somewhere...

I knew that things like that are in the Environment or Application classes a lot, and usually let intellisense and the documentation guide me from there. Helping others with problems is a good way of learning too.
 
Back
Top