Community discussion forum

Get Hard Disc Serial Number And Cpu ID through ASP.Net

Tags: asp.net India
  • 1 year ago

    Hai Freiends,

                  I want a solution for get Hard disc's serial number and CPU's id throug ASP.Net any one know about this please help me thanks in advance

  • 1 year ago

     Try using something like MachineInfo.GetInfo

    Joe 

  • 1 year ago

    Are you talking about your own server's CPU and HD information, or a client one?  I don't believe it's possible in any way to obtain such client info.

  • 1 year ago

    Sorry, my mistake I think MachineInfo just gets your own machine's info.. Only played around with it briefly.

    Joe 

  • 1 year ago
    Yes i want to know my own CPU and Harddisc serialnumber via ASP.Net ie client   
  • 1 year ago

    Had another play with MachineInfo. It will get you certain information from the client machine. However, you may want to take a look at:http://www.eggheadcafe.com/articles/20021019.asp .. as this seems to pick up the Hard Drive serial number using windows API's.

    Here's the mini class I have for the MachineInfo that I used. It may be useful to you at some point:

    using System;
    using System.Management;

    namespace MachineInfo
    {
        public class GetInfo
        {
            ManagementObject disk = null;

            public GetInfo(string strDriveLetter)
            {
                if (strDriveLetter == "" || strDriveLetter == null) strDriveLetter = "C";

                disk = new ManagementObject("win32_logicaldisk.deviceid=\"" + strDriveLetter + ":\"");
                disk.Get();
            }

            public string GetPropertyValue(string propertyName)
            {
                try
                {
                    return disk[propertyName] == null ? String.Empty : propertyName + ": " + disk[propertyName].ToString();
                }
                catch (ManagementException)
                {
                    return String.Empty;
                }
            }

            public string GetPropertyNameList()
            {
                string s = String.Empty;

                foreach (PropertyData d in disk.Properties)
                {
                    s += d.Name + ",";
                }
                return s;
            }
        }
    }
     

            protected void GetMachineInfo_Click(object sender, EventArgs e)
            {
                GetInfo qa = new GetInfo("c");
                string[] a = qa.GetPropertyNameList().Split(',');

                for (int i = 0; i<a.Length; i++)
                {
                    ListBox1.Items.Add(qa.GetPropertyValue(a[i]));
                }
            }

     

    Joe
     

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback