("Capacity: {0} M", hdd. Capacity );
The following is all the code:
Using System;Using System. Runtime. InteropServices;Using System. Text;
Namespace Sunmast. Hardware{[Serializable]Public struct HardDiskInfo{/// /// Model/// Public string ModuleNumber;/// /// Firmware version/// Public string Firmware;/// /// Serial number/// Public string SerialNumber;/// ///
In the last session, Yan Feng told you how to read the MAC address of a computer and how to obtain the hard disk serial number. The physical serial number of the hard disk is the factory serial number of the hard disk. It is globa
Obtain the CPU serial number, hard disk ID, and nic MAC address.
Private void getinfo (){String cpuinfo = ""; // CPU serial numberManagementclass cimobject = new managementclass ("win32_processor ");Managementobjectcollection MOC = cimobject. getinstances ();Foreach (managementobject Mo in MoC){Cpuinfo = Mo. properties ["processorid"]. value. tostring ()
There are a number of scenarios and requirements that you need to use a unique identifier for your mobile device.In Android, there are several ways to get such an ID.1. The IMEI: only valid for Android phones:
12
(telephonymanager)getsystemservice(telephony_servicetelephonymgr. Getdeviceid
With this approach, you need to include a license in Androidmanifest.xml: Android.permission.READ_PHONE_STATE, and the use
C # obtain the hard disk serial number
// ======================== Call method =========================== ====================
Harddiskinfo HDD = atapidevice. gethddinfo (0); // the first hard disk
Console. writeline ("module number: {0}", HDD. modulenumber );
Console. writeline ("serial
Mobile phone developers often need to use adb to connect multiple devices of the same product model on one PC at the same time, many times the usb serial number is the same, so that the same PC cannot be connected to multiple identical devices at the same time. For example, some occasional problems require a large sample size for testing.1. First, the mobile term
The usual view is "don't handle strings in the kernel"! Indeed, it should be so!
The Linux kernel's block device driver has the ability to read the disk's serial number, which is stored in the disk's control chip ROM. In what form should the kernel render this sequence number to the caller? We do ls this directory:
/dev/disk/by-id
Ll/dev/disk/by-id/. lrwxrwxrw
Using system;
Using system. runtime. interopservices;
Using system. management;
Namespace hardware
{
///
/// Summary of hardware_mac.
///
Public class hardwareinfo
{
// Obtain the machine name
Public string gethostname ()
{
Return system.net. dns. gethostname ();
}
// Obtain the cpu ID
Public string getcpuid ()
{
Try
{
Managementclass mc = new managementclass ("win32_processor ");
Managementobjectcollection moc = mc. getinstances ();
String strcpuid = null;
Foreach (managementobject mo in moc)
Read the code, model and sub-position of the serial number of the USB HDD (USB removable hard drive).Compiled successfully with Visual Studio 2010.The code uses the relevant code in code SMARTATA.C in Crystaldiskinfo:The following connection explains why the use of SCSI-related code requires the data conversion of the USB IC.http://blog.csdn.net/waityoualife/arti
MAC address of the NIC
Select macaddress from win32_networkadapter where (macaddress is not null) and (manufacturer
Result: 08: 00: 46: 63: FF: 8C
Serial number of the CPU
Select processorid from win32_processor
Result: 3febf9ff00000f24
Motherboard serial number
Select serialnumber from win32_bios
Result: 2836
Sometimes you need to obtain information about some hardware devices on the computer in C #, such as the CPU serial number and hard disk ID ,.. Net System. management. managementclass supports device management, which indicates the CIM management class. The management class is a WMI class, such as win32_logicaldisk and win32_process. The former indicates the disk drive, and the latter indicates the process
The requirement list in project development shows that you want to see the total number of items clearly, so you need to start with the number 1.The following is a 1-based serial number display:S:iteratorvalue= "#request. Pageview.records"var= "Model"Status= "Stat">TR>TDwidt
This article collects C + + reads the CPU serial number the related information
1. WMIC command
Open Cmd.exe as an administrator,
C:\windows\system32>wmic CPU Get Processorid
ProcessoridBfebfbff****06e3
The BF begins with the ID number of the CPU, length "16", and the current processor model is "INTEL CORE i5".-
Code for reading the serial number of usb hdd (USB mobile hard disk Information)
Code, model, and split of the serial number of the usb hdd.
Visual Studio 2010 is successfully compiled.
The Code uses the related code in smartata. c In CrystalDiskInfo:
The following connectio
Code for reading the serial number of usb hdd (USB mobile hard disk information), USB HDD
Code, model, and split of the serial number of the usb hdd.
Visual Studio 2010 is successfully compiled.
The Code uses the related code in smartata. c In CrystalDiskInfo:
The following
Hard disk
private void GetInfo (){String cpuInfo = "";//cpu serial numberManagementClass cimobject = new ManagementClass ("Win32_Processor");Managementobjectcollection MOC = Cimobject. GetInstances ();foreach (ManagementObject mo in MOC){CpuInfo = mo. properties["Processorid"]. Value.tostring ();Response.Write ("CPU serial Number:" +cpuinfo.tostring ());}
Get the
Here is a small program hdsn32.asm, I wrote in 2000, read the serial number of the hard drive under Win9x, it took advantage of similar CIH virus method to obtain RING0 permissions, under the Win2000 can not run.
; Hdsn32.asm
.386
. Model flat, stdcall; Bit memory model
Option Casemap:none; Case sensitive
Include \mas
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.