Description

This code gives you the ability to retrieve the Dell Service Tag

Source Code

// This script was initially posted at http://mariohenkel.de/?p=153

private string GetServiceTag()
{
     string dellServiceTag = "";

     try
      {
        ManagementClass wmi = new ManagementClass("Win32_Bios");

        foreach (ManagementObject bios in wmi.GetInstances())
         {
           dellServiceTag = bios.Properties["Serialnumber"].Value.ToString().Trim();
         }
         return dellServiceTag;
       }
      catch (Exception e)
       {
         MessageBox.Show("Error while getting Dell Service Tag:\n\n" +
           e.ToString());

         dellServiceTag = "N/A";

         return dellServiceTag;
        }
    }
1 Spice up