Never mind, guys. I figured it out.
For those interested - use the osVersion property of the Environment
class under the System namespace.
The osVersion property is an object of the operatingSystem class which
in return gives you access to the operatingSystem platform and version
properties. This can then be used to retrieve the platform and version
information of the operating system that the server is running on.
Note that the version property is an object of the Version class. This
gives you access to the build, major, minor and revision properties.
I won't leave you guys hanging without an example (:))
(the text succeeding the '->' indicates what is returned to the browser)
Response.write( environment.osVersion.version ) -> 5.1.2499.0
This in layman terms means that I am running Microsoft Windows 5.1 (XP)
build 2499, revision 0.
Response.write( environment.osVersion.version.build ) -> 2499
Here I'm accessing the build property of the version class, which
returns the build number as an integer.
If I can be of any further assistance with this, don't hesitate to ask.
chris sano | webdev intern - web infrastructure team |
t-csano@m... <mailto:t-csano@m...>
-----Original Message-----
From: Chris Sano [mailto:t-csano@m...]
Sent: Friday, June 22, 2001 7:15 PM
To: aspngstart; aspx_beginners@p...;
Subject: [aspngstart] operating system version
Does anyone know how to use ASP.NET (beta2) to grab the name of the
operating system and version that the server is running on?
The only way I can think of doing this is through a stored procedure
that executes the 'ver' command from the command prompt and extracts the
result from there. Is there another way?
Thanks.