You can get Operation System (OS) name and major version and minor version details,service pack and build details of server using "System.Environment" class.
We can use OSVersion property of Environment Class which will return "OperatingSystem" class.
Here is example for this.
In this example we display server name ,it's version details , service pack and build details.
C# Examples :
VB.net Example :
Output :
This type of C# Tips is very useful in day to day programming life.
Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.
We can use OSVersion property of Environment Class which will return "OperatingSystem" class.
Here is example for this.
In this example we display server name ,it's version details , service pack and build details.
C# Examples :
Response.Write("<b>OS Platform :</b> " + Environment.OSVersion.Platform); Response.Write("<br/><br/>"); Response.Write("<b>OS Major Version :</b> " + Environment.OSVersion.Version.Major); Response.Write("<br/><br/>"); Response.Write("<b>OS Minor Version :</b> " + Environment.OSVersion.Version.Minor); Response.Write("<br/><br/>"); Response.Write("<b>OS Build number :</b> " + Environment.OSVersion.Version.Build); Response.Write("<br/><br/>"); Response.Write("<b>OS Service Pack :</b> " + Environment.OSVersion.ServicePack); Response.Write("<br/><br/>"); Response.Write("<b>OS Version String :</b> " + Environment.OSVersion.VersionString);
VB.net Example :
Response.Write("<b>OS Platform :</b> " & Environment.OSVersion.Platform.ToString()) Response.Write("<br/><br/>") Response.Write("<b>OS Major Version :</b> " & Environment.OSVersion.Version.Major) Response.Write("<br/><br/>") Response.Write("<b>OS Minor Version :</b> " & Environment.OSVersion.Version.Minor) Response.Write("<br/><br/>") Response.Write("<b>OS Build number :</b> " & Environment.OSVersion.Version.Build) Response.Write("<br/><br/>") Response.Write("<b>OS Service Pack :</b> " & Environment.OSVersion.ServicePack) Response.Write("<br/><br/>") Response.Write("<b>OS Version String :</b> " & Environment.OSVersion.VersionString) Response.Write("<br/><br/>")
Output :
Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.
best drill machine in india
ReplyDeletebusiness whatsapp groups
ReplyDeleteReally infomational and educative article thanks publisher for sharing this wonderful info i have shared this article on my blog tecktak flippzilla
ReplyDeleteand whatsaup, and Best smart tv
Amazing information i really enjoyed this article reall great article keep publishing i have bookmarked this blog for future post
ReplyDeletegossipmouth flippzilla