Email: Password:       Forgot Password 
    .netCodeSG
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
 
TECHNOLOGIES:
 

Show BIOS Details in ASP.NET

Article:
Viewed:  1251 
Posted On:  09/01/2014 09:24:54 
How we can get all BIOS details in ASP.NET ? 

In this article I am going to explain how we can get the BIOS detail in ASP.NET.

I created a new application name with Get BIOS Detail.  Now I am going to add  a reference of System.Management

Right Click on Solution Explorer -> Add Reference

Get BIOS Detail 1.png

Image 1.

Get BIOS Detail 2.png

Image 2.

Below is my aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BIOSDetail.aspx.cs" Inherits="Get_BIOS_Detail.BIOSDetail" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        html {
            font-size: 10pt;
            font-family: Verdana;
            color: blue;
        }
    </style>
 
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
</body>
</html>

My aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; 

namespace Get_BIOS_Detail
{
    public partial class BIOSDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                GetAllBIOSDetail();
        } 

        private void GetAllBIOSDetail()
        {
            SelectQuery SqlQuery = new SelectQuery("Win32_BIOS");
            ManagementObjectSearcher objOSDetails = new ManagementObjectSearcher(SqlQuery );
            ManagementObjectCollection osDetailsCollection = objOSDetails.Get();
            foreach (ManagementObject mo in osDetailsCollection)
            {
                Response.Write("Name : " + mo["Name"].ToString() + "<br/>");
                string[] BIOSVersion = (string[])mo["BIOSVersion"];
                string myBIOSDetail = null;
                foreach (string version in BIOSVersion)
                {
                    myBIOSDetail += version;
                }
                Response.Write("BIOSVersion : "myBIOSDetail + "<br/>");
                Response.Write("Caption : " + mo["Caption"].ToString() + "<br/>");
                Response.Write("Description : " + mo["Description"].ToString() + "<br/>");
                Response.Write("InstallableLanguages : " + Convert.ToUInt16(mo["InstallableLanguages"]).ToString() + "<br/>");
                Response.Write("InstallDate : " + Convert.ToDateTime(mo["InstallDate"]).ToString() + "<br/>");
                Response.Write("Manufacturer : " + mo["Manufacturer"].ToString() + "<br/>");
                Response.Write("PrimaryBIOS : " + mo["PrimaryBIOS"].ToString() + "<br/>");
                Response.Write("ReleaseDate : " + mo["ReleaseDate"].ToString() + "<br/>");
                Response.Write("SerialNumber : " + mo["SerialNumber"].ToString() + "<br/>");
                Response.Write("SMBIOSBIOSVersion : " + mo["SMBIOSBIOSVersion"].ToString() + "<br/>");
                Response.Write("SMBIOSMajorVersion : " + mo["SMBIOSMajorVersion"].ToString() + "<br/>");
                Response.Write("SMBIOSMinorVersion : " + mo["SMBIOSMinorVersion"].ToString() + "<br/>");
                Response.Write("SMBIOSPresent : " + mo["SMBIOSPresent"].ToString() + "<br/>");
                Response.Write("SoftwareElementID : " + mo["SoftwareElementID"].ToString() + "<br/>");
                Response.Write("SoftwareElementState : " + mo["SoftwareElementState"].ToString() + "<br/>");
                Response.Write("Status : " + mo["Status"].ToString() + "<br/>");
                Response.Write("TargetOperatingSystem : " + mo["TargetOperatingSystem"].ToString() + "<br/>");
                Response.Write("Version: " + mo["Version"].ToString() + "<br/>");
            } 
        }
    }
}


Run the program

Get BIOS Detail 3.png

Image 3.

  Comment:
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us