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/article/details/5656589The implementation code is
The engineer reported today that our program cannot obtain the machine code (hard disk serial number) under Vista ). After searching for information from Google and the help of msdn, we finally got it done.
There are many examples of VB. NET code on the Internet.
C #
String info = "";Managementclass MC = new managementclass ("win32_physicalmedia ");Managementobjectcollection MOC = mc. getinstances ();For
Using system;Using system. IO;Using system. runtime. interopservices;Using system. text;Using Microsoft. Win32;
Namespace wjb. readorwriteiniandreg{/**/////// Read the hard disk serial number of the specified drive letter///Public class harddiskval{[Dllimport ("kernel32.dll")]Private Static extern int getvolumeinformation (String lprootpathname,String lpvolumenamebuffer,Int nvolumenamesize,Ref int lpvolumes
Publish an extension for getting the PHP hard drive serial number: why ;? Ph releases an extension for getting the PHP hard drive serial number
: Http://sharego.org/php_diskserial.dll
Usage
1. copy the file to the php/ext directory and modify php. ini to add extension = php_diskserial.dll.
2. restart Apache
3,
Hard drive ' Gets the hard drive serial number
Dim Cmicwmi as New System.Management.ManagementObjectSearcher ("SELECT * from Win32_DiskDrive")
Dim Uint32 as UInt32
For each cmicwmiobj as ManagementObject in Cmicwmi.get
Uint32 = cmicwmiobj ("signature")
Next
TextBox1.Text = uint32.tostring
' Get CPU serial numb
Use ls-l to see the number of hard links of a document: [root @ localhosttmp] # ls-litotal104229415drwxr-xr-x2rootroot4096Dec1121: 15etc3167-rw-r -- r -- 2 root
Use ls-l to view the number of hard links of a document:
[Root @ localhost tmp] # ls-liTotal 104229415 drwxr-xr-x 2 root 4096 Dec 11 etc39757-rw-r -- 2 root 16
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
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 specific problem is this: I use the following this section of the code to obtain hard disk information into the EXE file, when testing on the machine, there is a direct double-click Run and run as administrator, the result is not the same situation, how to solve this problem?1 Public StaticString Gethardwareid ()2 {3String num =NULL;4ListNewliststring>();5ManagementClass MC =NewManagementClass ("Win32_physicalmedia");6Managementobjectcoll
them again. But it's too slow. So I wrote the following code.
Color: blue; mso-font-kerning: 0pt; mso-no-proof: yes '> Update0pt; mso-no-proof: yes '> aTable Set aColumn = @ MaxInt * RAND ()
Mso-ascii-theme-font: minor-latin; mso-fareast-font-family:; mso-fareast-theme-font:Minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin "> the results are totally unexpected, the values in this column are all the same!
Mso-as
A wordpress website runs on Linux, but it is abnormal recently in the form of instantaneous generation of massive session files (more than 11 million) in the tmp directory, and 400% of the CPU in an instant, the hard disk is directly cracked (90 GB), resulting in many server downtime files until the ls and rm commands are used... A wordpress website runs on Linux, but it is abnormal recently.
The specific manifestation is:The/tmp directory instantly
First load. dll, assembly. Load ("XXX. dll ");And then reflection.The premise of reflection is the sameProgramSet. You can compile different namespaces into the same set of programs.Classes in the same namespace can be reflected to objects by class names, but other namespaces cannot (with space restrictions added). I don't know why; find another program to obtain the hard disk serial number!
Obtain the
Look at the other data have extracted Cpu,mac ready-made code but no hard disk serial number, looking for a long time to find the parameters of the HDD serial number. So I made up for it.
Find the code here:
For people who have written ASP or. NET, it is very familiar to obtain the hardware information of the client through ASP or. NET language. But how do you
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: 28362630-3700521
Obtain the hard disk IDString H
Getting the serial number is the information to read the soft hard disc, which can be obtained by using the following function:
Public Declare Function getvolumeinformation Lib "kernel32.dll" Alias "Getvolumeinformationa" (ByVal lpRootPathName as St Ring, ByVal Lpvolumenamebuffer as String, ByVal nvolumenamesize as Integer, Lpvolumeserialnumber as Long, Lpmaximumcompone Ntlength as Long, lpfilesystemflags
C # How to obtain the physical serial number of a hard disk
Using system;Using system. runtime. interopservices;Using system. Management;Namespace hardware{/// /// Summary of hardware_mac./// Public class hardwareinfo{// Obtain the machine namePublic String gethostname (){Return System. net. DNS. gethostname ();}
// obtain the CPU number Public String getcpu
With the popularity of the movie "color shield", a large number of "color shield" viruses have been spreading on the Internet recently. According to statistics from rising companies, as of yesterday, there were hundreds of websites, forums, and blogs with "Drugs" on the Internet, users only need to browse These webpages or download the movie "
Using system;Using Microsoft. Win32;Using system. Globalization;Using system. runtime;Using system. runtime. interopservices;Using system. text;Using system. IO;Namespace hkh. Common{/// /// Summary description for clside./// Public class clside{/// /// Obtain the serial number of the corresponding partition of the hard disk/// /// Public static string getallserialnumber (){String dri = "";
System. Manage
// Obtain the serial number of the hard disk:
Function getideserialnumber: pchar; // gets the factory serial number of the hard disk;
Const
Identify_buffer_size = 512;
Type
Tideregs = packed record
Bfeaturesreg: byte;
Bsectorcounregulatory: byte;
Bsectornumberreg: byte;
Bcyllowreg: byte;
Bcylhighreg: byte;
Bdriveheadre
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.