在系统的Mac地址上进行身份验证 [英] authentication on mac address of a system

查看:522
本文介绍了在系统的Mac地址上进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将系统的mac地址提取到文本文件中,然后在登录页面上使用相同的密码将其保存到数据库thn中后进行加密?

how to fetch mac address of system in to a text file.then after encryting saving it in database thn using the same for autentication on login page?

推荐答案

您的Web应用程序无权访问客户端计算机.您想要这样做吗?安全性如何?

—SA
You Web application has no access to a client computer. Would you like it do to so? How about security?

—SA


正如SA所说,需要良好的安全性,更不用说MAC地址容易被伪造了.
As SA stated, good security would be needed, also not to mention that MAC address can be easily faked.


这是非常关键的..

但是我已经解决了这个问题.

为此,我创建了一个接口来获取Machine的MAC地址并使用
.msi安装程序以在客户端计算机上安装此应用程序.

使用.cab文件,.inf文件,CABARC.exe文件可以在客户端计算机上安装此应用程序,但这只能在Internet Explorer中进行.

这是有关如何在Asp.Net中创建Activex控件以及如何在客户端上安装Activex控件的参考URL.

http://haseebakhtar.wordpress.com/2011 /05/31/creating-an-activex-control-in-net-using-c/ [ ManagementObjectCollection moc = mc.GetInstances();
字符串MACAddress = String.Empty;
foreach(moc中的Managementment mo)
{
if(MACAddress == String.Empty)//仅从第一张卡返回MAC地址
{
if((bool)mo ["IPEnabled"] == true)MACAddress = mo ["MacAddress"].ToString();
}
mo.Dispose();
}
返回MACAddress.Replace(:",");

这将正常工作.

如有任何疑问,您可以与我联系.

萨钦.
This is very critical..

But i have solve this problem.

for that i have create an interface to fetch MAC address of Machine and used
.msi installer to install this application on client machine.

And using .cab file , .inf file , CABARC.exe file you can install this application on client machine but this is only possible in Internet Explorer.

This is reference URL to how to create Activex Control in Asp.Net and how to install it on Client Side.

http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/[^]

And to retrieve CLient Machines MAC Address use this following code.

ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
string MACAddress = String.Empty;
foreach (ManagementObject mo in moc)
{
if (MACAddress == String.Empty) // only return MAC Address from first card
{
if ((bool)mo["IPEnabled"] == true) MACAddress = mo["MacAddress"].ToString();
}
mo.Dispose();
}
return MACAddress.Replace(":", "");

This will work properly.

In case any queries then you can contact me.

Sachin.


这篇关于在系统的Mac地址上进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆