Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Get BIOS Date

Get BIOS Date

Scheduled Pinned Locked Moved C#
7 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rhtbhegade
    wrote on last edited by
    #1

    HI Experts, I want to get the BIOS date in my project.Inspite of change in the date from the "Date and Time Properties" the date that i want is the date in the BIOS.

    H T 2 Replies Last reply
    0
    • R rhtbhegade

      HI Experts, I want to get the BIOS date in my project.Inspite of change in the date from the "Date and Time Properties" the date that i want is the date in the BIOS.

      H Offline
      H Offline
      himanshu2561
      wrote on last edited by
      #2

      Hi Try this <pre>             RegistryKey RK = Registry.LocalMachine;             RK = RK.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");             Object Date = RK.GetValue("SystemBiosDate");             string ss = Date.ToString(); </pre>

      himanshu

      F 1 Reply Last reply
      0
      • R rhtbhegade

        HI Experts, I want to get the BIOS date in my project.Inspite of change in the date from the "Date and Time Properties" the date that i want is the date in the BIOS.

        T Offline
        T Offline
        Tamer Oz
        wrote on last edited by
        #3

        You can quety WMI with System.Management Namespace Here is an example. ReleaseDate property is what you are looking for

           private void Form1\_Load(object sender, EventArgs e)
            {
                List("Select \* from Win32\_BIOS");
            }
        
            private void List(string query)
            {
                ManagementObjectSearcher m = new ManagementObjectSearcher();
                m.Query = new ObjectQuery(query);
                foreach (ManagementObject mo in m.Get())
                {
                    foreach (PropertyData pd in mo.Properties)
                    {
                        if (mo\[pd.Name\] != null)
                        {
                            if (mo\[pd.Name\] is string\[\])
                            {
                                foreach (string s in (string\[\])mo\[pd.Name\])
                                {
                                    MessageBox.Show(s);
                                }
                            }
                            else
                            {
                                MessageBox.Show(pd.Name + ":" + mo\[pd.Name\].ToString());
                            }
                        }
                    }
                }
            }
        
        R 1 Reply Last reply
        0
        • T Tamer Oz

          You can quety WMI with System.Management Namespace Here is an example. ReleaseDate property is what you are looking for

             private void Form1\_Load(object sender, EventArgs e)
              {
                  List("Select \* from Win32\_BIOS");
              }
          
              private void List(string query)
              {
                  ManagementObjectSearcher m = new ManagementObjectSearcher();
                  m.Query = new ObjectQuery(query);
                  foreach (ManagementObject mo in m.Get())
                  {
                      foreach (PropertyData pd in mo.Properties)
                      {
                          if (mo\[pd.Name\] != null)
                          {
                              if (mo\[pd.Name\] is string\[\])
                              {
                                  foreach (string s in (string\[\])mo\[pd.Name\])
                                  {
                                      MessageBox.Show(s);
                                  }
                              }
                              else
                              {
                                  MessageBox.Show(pd.Name + ":" + mo\[pd.Name\].ToString());
                              }
                          }
                      }
                  }
              }
          
          R Offline
          R Offline
          rhtbhegade
          wrote on last edited by
          #4

          i could not find the system.management namespace please help......

          T 1 Reply Last reply
          0
          • R rhtbhegade

            i could not find the system.management namespace please help......

            T Offline
            T Offline
            Tamer Oz
            wrote on last edited by
            #5

            Have you tried adding reference to a .net library and search that list for System.Management. System.Management dll is in .net since 1.1 version.

            R 1 Reply Last reply
            0
            • T Tamer Oz

              Have you tried adding reference to a .net library and search that list for System.Management. System.Management dll is in .net since 1.1 version.

              R Offline
              R Offline
              rhtbhegade
              wrote on last edited by
              #6

              Thanks.....

              1 Reply Last reply
              0
              • H himanshu2561

                Hi Try this <pre>             RegistryKey RK = Registry.LocalMachine;             RK = RK.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\");             Object Date = RK.GetValue("SystemBiosDate");             string ss = Date.ToString(); </pre>

                himanshu

                F Offline
                F Offline
                Fred 34
                wrote on last edited by
                #7

                very good answer thanks. only mention to use these 2 lines b4 them using System.Security.Permissions; using Microsoft.Win32;

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups