資源簡(jiǎn)介
C# Windows 系統(tǒng)一鍵查詢?nèi)缦码娔X信息,方便快捷,有源碼,可以直接運(yùn)行。全網(wǎng)本類(lèi)別最全的下載資源。
1.cpu序列號(hào)
2.mac序列號(hào)
3.硬盤(pán)id
4.ip地址
5.登錄用戶名
6.計(jì)算機(jī)名
7.系統(tǒng)類(lèi)型
8.內(nèi)存量 單位:M
9.硬盤(pán)卷標(biāo)號(hào)
10.獲取BIOS序列號(hào)

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Management;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?QueryPCInfos
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?myStr?=?““;
????????????this.textBox1.Text?=?““;
????????????myStr?+=?“CPU型號(hào):“?+?Computer.CpuID.ToString()?+?“\r\n“;
????????????myStr?+=?“硬盤(pán)型號(hào):“?+?Computer.DiskID.ToString()+“\r\n“;
????????????myStr?+=?“硬盤(pán)卷標(biāo)號(hào):“?+?Computer.DiskVolumeSerialNumber.ToString()?+?“\r\n“;
????????????myStr?+=?“BIOS序列號(hào):“?+?Computer.BIOSSerialNumber.ToString()?+?“\r\n“;
????????????
????????????
????????????this.textBox1.Text?=?myStr;
????????}
????}
????public?class?Computer
????{
????????public?static?string?CpuID;?//1.cpu序列號(hào)
????????public?static?string?MacAddress;?//2.mac序列號(hào)
????????public?static?string?DiskID;?//3.硬盤(pán)id
????????public?static?string?IpAddress;?//4.ip地址
????????public?static?string?LoginUserName;?//5.登錄用戶名
????????public?static?string?ComputerName;?//6.計(jì)算機(jī)名
????????public?static?string?SystemType;?//7.系統(tǒng)類(lèi)型
????????public?static?string?TotalPhysicalMemory;?//8.內(nèi)存量?單位:M
????????public?static?string?DiskVolumeSerialNumber;?//9.硬盤(pán)卷標(biāo)號(hào)
????????public?static?string?BIOSSerialNumber;?//獲取BIOS序列號(hào)
????????
????????static?Computer()
????????{
????????????CpuID?=?getCpu();
????????????MacAddress?=?GetMacAddress();
????????????DiskID?=?GetDiskID();
????????????IpAddress?=?GetIPAddress();
????????????LoginUserName?=?GetUserName();
????????????SystemType?=?GetSystemType();
????????????TotalPhysicalMemory?=?GetTotalPhysicalMemory();
????????????ComputerName?=?GetComputerName();
????????????DiskVolumeSerialNumber?=?GetDiskVolumeSerialNumber();
????????????BIOSSerialNumber?=?getBIOSSerialNumber();
????????}
????????//1.獲取CPU序列號(hào)代碼?
????????static?string?GetCpuID()
????????{
????????????try
????????????{
????????????????string?cpuInfo?=?““;//cpu序列號(hào)?
????????????????ManagementClass?mc?=?new?ManagementClass(“Win32_Processor“);
????????????????ManagementobjectCollection?moc?=?mc.GetInstances();
????????????????foreach?(Managementobject?mo?in?moc)
????????????????{
????????????????????cpuInfo?=?mo.Properties[“ProcessorId“].Value.ToString();
????????????????}
????????????????moc?=?null;
????????????????mc?=?null;
????????????????return?cpuInfo;
????????????}
????????????catch
????????????{
????????????????return?“unknow“;
????????????}
????????????finally
????????????{
????????????}
????????}
????????//2.獲取網(wǎng)卡硬件地址?
????????static?string?GetMacAddress()
????????{
????????????try
????????????{
????????????????strin
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????187??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\App.config
?????文件??????12288??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\bin\Debug\QueryPCInfos.exe
?????文件????????187??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\bin\Debug\QueryPCInfos.exe.config
?????文件??????30208??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\bin\Debug\QueryPCInfos.pdb
?????文件??????23168??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\bin\Debug\QueryPCInfos.vshost.exe
?????文件????????187??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\bin\Debug\QueryPCInfos.vshost.exe.config
?????文件????????187??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\bin\Debug\WindowsFormsApplication1.vshost.exe.config
?????文件????????490??2010-03-17?22:39??QueryPCInfos\QueryPCInfos\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????文件???????9445??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\Form1.cs
?????文件???????2802??2017-12-29?15:06??QueryPCInfos\QueryPCInfos\Form1.Designer.cs
?????文件???????5817??2017-12-29?14:43??QueryPCInfos\QueryPCInfos\Form1.resx
?????文件???????1453??2017-12-29?14:48??QueryPCInfos\QueryPCInfos\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7473??2017-12-29?15:05??QueryPCInfos\QueryPCInfos\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????1160??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.csproj.FileListAbsolute.txt
?????文件????????977??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.csproj.GenerateResource.Cache
?????文件??????12288??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.exe
?????文件????????180??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.Form1.resources
?????文件??????30208??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.pdb
?????文件????????180??2017-12-29?16:38??QueryPCInfos\QueryPCInfos\obj\Debug\QueryPCInfos.Properties.Resources.resources
?????文件??????????0??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????4608??2017-12-29?15:05??QueryPCInfos\QueryPCInfos\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件???????1437??2017-12-29?14:34??QueryPCInfos\QueryPCInfos\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
?????文件????????977??2017-12-29?12:02??QueryPCInfos\QueryPCInfos\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
?????文件???????2531??2017-12-29?12:02??QueryPCInfos\QueryPCInfos\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
?????文件????????524??2017-12-29?15:06??QueryPCInfos\QueryPCInfos\Program.cs
?????文件???????1372??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\Properties\AssemblyInfo.cs
?????文件???????2864??2017-12-29?15:05??QueryPCInfos\QueryPCInfos\Properties\Resources.Designer.cs
?????文件???????5612??2017-12-29?11:49??QueryPCInfos\QueryPCInfos\Properties\Resources.resx
............此處省略18個(gè)文件信息
評(píng)論
共有 條評(píng)論