社区
C#
帖子详情
如何得到服务器硬盘的物理序列号~
gggg139
2004-09-05 04:12:27
请注意:是物理序列号
自己没亲自试过的代码就不要贴上来了
谁第一个帮我解决,分就给谁
...全文
709
6
打赏
收藏
如何得到服务器硬盘的物理序列号~
请注意:是物理序列号 自己没亲自试过的代码就不要贴上来了 谁第一个帮我解决,分就给谁
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
cnming
2004-09-05
打赏
举报
回复
试着把你的程序放在WebService上看看
coollzh
2004-09-05
打赏
举报
回复
估计是权限问题
gggg139
2004-09-05
打赏
举报
回复
为什么这段代码放在ASP.NET就没任何显示
Tomgus
2004-09-05
打赏
举报
回复
还有个问题首先得考虑的就是你的硬盘是不是SCSI硬盘
如果是,那么根本不存在"物理序列号",只可能取得卷标的序列号
如果是卷标序列号,要注意的是每次格式化硬盘的时候这个序列号都会变
代码可以参考:
http://www.csdn.net/Develop/Read_Article.asp?Id=25196
如果是物理序列号:
String HDid;
ManagementClass cimobject = new ManagementClass("Win32_DiskDrive");
ManagementObjectCollection moc = cimobject.GetInstances();
foreach(ManagementObject mo in moc)
{
HDid = (string)mo.Properties["Model"].Value;
MessageBox.Show(HDid );
}
Tomgus
2004-09-05
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Management ;
namespace WindowsApplication1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(24, 24);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 104);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(240, 23);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// label2
//
this.label2.Location = new System.Drawing.Point(24, 134);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(240, 23);
this.label2.TabIndex = 2;
this.label2.Text = "label2";
//
// label3
//
this.label3.Location = new System.Drawing.Point(24, 164);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(240, 23);
this.label3.TabIndex = 3;
this.label3.Text = "label3";
//
// label4
//
this.label4.Location = new System.Drawing.Point(24, 194);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(240, 23);
this.label4.TabIndex = 4;
this.label4.Text = "label4";
//
// label5
//
this.label5.Location = new System.Drawing.Point(24, 224);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(240, 23);
this.label5.TabIndex = 5;
this.label5.Text = "label5";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
ManagementObjectSearcher my = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard");
foreach(ManagementObject share in my.Get())
{
label1.Text= "主板制造商:" + share["Manufacturer"].ToString();
label2.Text= "产品:" + share["Product"].ToString();
label3.Text= "主板序列号:" + share["SerialNumber"].ToString();
}
//得到cpu序列号
string strCPUNo = "";
ManagementClass cimObject = new ManagementClass("Win32_Processor");
ManagementObjectCollection mocHard = cimObject.GetInstances();
foreach(ManagementObject moHard in mocHard)
{
strCPUNo = moHard.Properties["ProcessorId"].Value.ToString();
}
label4.Text = "CPU序列号为:" + strCPUNo;
//硬盘序列号
ManagementObject m_objDisk = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
string strSN = (string)m_objDisk.GetPropertyValue("VolumeSerialNumber");
label5.Text = "硬盘序列号为:" + strSN ;
}
}
}
使用 System.Management,注意,要在项目中将此组件引用进来。
Tomgus
2004-09-05
打赏
举报
回复
http://dotnet.aspx.cc/ShowDetail.aspx?id=6977HLMY-ELPN-4KIR-BI89-7YS2LNENT5HR
服务器
系统盘符确定
硬盘
槽位
storcli64 /c0/e29/s5 start locate命令的/c0/e29/s5的0、29、5分别表示
硬盘
所在RAID卡的ID号、Enclosure的ID号和
硬盘
槽位号,其中RAID卡的ID号和Enclosure的ID号可在步骤2.2中查找到的
硬盘
序列号
所在的
硬盘
信息中查询到。
硬盘
序列号
所在的
硬盘
信息中的“Slot Number”对应的信息即为
硬盘
槽位号信息。在查找到的
硬盘
序列号
所在的
硬盘
信息中/c0/e29/s5中s5的5即为
硬盘
槽位号。c.通过
硬盘
序列号
确认
硬盘
槽位号。
通过MATLAB读取计算机的主板
序列号
,
硬盘
序列号
,CPU
序列号
,BIOS
序列号
,网卡
序列号
对于包含硬件
序列号
获取功能的 Matlab 代码,如果涉及到商业应用或敏感信息处理,可以考虑使用 Matlab 提供的加密工具对代码进行加密,或者使用代码混淆工具对代码进行处理,增加代码的阅读和逆向工程难度,保护代码逻辑和知识产权。软件在安装或运行时,读取硬件
序列号
并与授权
服务器
上记录的合法
序列号
进行比对,只有
序列号
匹配的计算机才能正常使用软件,防止软件被非法复制和传播。不过需要注意的是,在某些系统中,获取到的可能并非传统意义上唯一的
物理
序列号
,而是特定的处理器标识。
linux
硬盘
物理
序列号
修改,Linux 常用命令
显示消耗内存CPU最多的10个进程ps aux|sort -nrk +3|head -10ps aux|sort -nk +3 |tail -10显示消耗内存MEM最多的10个进程ps aux|sort -nrk +4|head -10ps aux|sort -nk +4 |tail -10------------------------------------------------------...
linux 查看主板sn_怎么查看Linux
服务器
硬件信息,这些命令告诉你
Linux
服务器
配置文档找不到,你还在为查询Linux
服务器
硬件信息发愁吗?学会这些命令,让你轻松查看Linux
服务器
的CPU,内存,
硬盘
,SN
序列号
等信息,根本就不用去机房。一、查看CPU信息CPU信息常常包括查看CPU型号信息,
物理
CPU个数,每个
物理
CPU中core的个数(即核数),逻辑CPU个数信息。默认Linux
服务器
中,这些信息都保存在/proc/cpuinfo文件中,通过cat命令结...
怎么查看Linux
服务器
硬件信息,这些命令告诉你
Linux
服务器
配置文档找不到,你还在为查询Linux
服务器
硬件信息发愁吗?学会这些命令,让你轻松查看Linux
服务器
的CPU,内存,
硬盘
,SN
序列号
等信息,根本就不用去机房。 一、查看CPU信息 CPU信息常常包括查看CPU型号信息,
物理
CPU个数,每个
物理
CPU中core的个数(即核数),逻辑CPU个数信息。默认Linux
服务器
中,这些信息都保存在/proc/cpuinfo文件中,通过以下命令我们可以很容易查询出来。 1、查看CPU型号信息 [root@localhost ~]# cat /proc/c
C#
111,129
社区成员
642,540
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章