Recently, due to the needs of the project, the need to get the machine's hard drive serial number and MAC address information, under C #, it is easy to obtain this information, but in the C + + program feel more trouble. After Baidu, found that a lot of prawns are through the WMI to obtain these hardware information, t
:= ' 0 '; End; End The following function gets the BIOS number {*************************************** author/date:description: Gets the BIOS number ********} function getbiosnum:string; Var biosdate,biosname,biosversion,biosnum,bioscopyright:string; Begin Try Biosdate:=string (Pchar (PTR ($ffff 5)); Biosname:=string (Pchar (PTR ($ffa 68))); Biosversion:=string (Pchar (PTR ($fe 061)
Original: C#/vb.net get computer properties (hard drive ID, hard disk capacity, CPU serial number, MAC address, System type)In the development process, it is often necessary to obtain some properties of the computer, such as obtaining the
Hard disk
Using System;Using System.IO;Using System.Runtime.InteropServices;Using System.Text;Using Microsoft.Win32;
Namespace Wjb.readorwriteiniandreg{/**////Read the hard drive sequence number of the specified drive letter///public class Harddiskval{[DllImport ("kernel32.d
original author's code can be used to obtain hard drive serial numbers without administrator permissions. I will not analyze the original code, just let me talk about the modified content.
Readphysicaldriveinntwithzerorights is commented out by the original author. I don't know why. This method is used to obtain the hard
Recently installed a software for research, need to use the hard disk serial number to verify. Before another server has been installed, if you can change the serial number of the current hard
Recently in contact with the Software registration module, you need to obtain the hard drive serial number to generate the registration code.HDD serial number, English name: Hard disk
Recently installed a software for research, you need to use the hard drive serial number to verify. Before the other server has been installed, if you can change the current hard disk's serial
C # uses the Win32 Api to modify the local system time, obtain the hard drive serial number, can be used to write software registration mechanism! The code is as follows: Using System; Using System.Collections.Generic; Using System.Text; Using System.Runtime.InteropServices; Namespace Fengyun { public class Win32 { #re
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
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 getvolumeinformat
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 o
Problem | The registration mechanism of the hard disk general software can be obtained by acquiring the hardware serial number and then using the asymmetric encryption algorithm to generate the corresponding public and private key. But using managed code to get the hard drive
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 seria
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
There is no good solution when I find the serial number of the SCSI hard disk on the Internet. Most of the information on the Internet is about the IDE hard disk. After a large number of searches, I finally found an effective method, post it to share with you:
The Code is as
Using system. Management;
/// /// Obtain the MAC address/// /// Public String getnetcardmacaddress (){Managementclass MC;Managementobjectcollection MOC;MC = new managementclass ("win32_networkadapterconfiguration ");MoC = mc. getinstances ();String STR = "";Foreach (managementobject Mo in MoC){If (bool) Mo ["ipenabled"] = true)STR = Mo ["macaddress"]. tostring ();
}Return STR;}
/// /// Serial number of
I looked at other materials, including CPU extraction, but there was no hard disk serial number in MAC out-of-the-box code. After searching for a long time, I found the parameter for extracting the hard disk serial number. So I ma
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.