限制拷贝(绑定硬件)
来源:互联网 发布:码工助手和疯狂美工 编辑:程序博客网 时间:2024/06/09 23:53
using System.Management;
using Microsoft.Win32;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Text;
using System.Xml;
protected void Button1_Click(object sender, EventArgs e)
{
//读本机的MAC 地址 ;
string mac = "";
ManagementClass mc;
mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
//mc = new ManagementClass("Win32_BIOS");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (mo["IPEnabled"].ToString() == "True")
mac = mo["MacAddress"].ToString();
}
this.TextBox1.Text = mac + ":12";
XmlDocument xmlDom = new XmlDocument();
string aaa = HttpContext.Current.Server.MapPath("web.config").ToString();
xmlDom.Load((HttpContext.Current.Server.MapPath("web.config")));
string path = "descendant::configuration/appSettings/add[@key=/"RegisterID/"]";
XmlNode node = xmlDom.SelectSingleNode(path);
if (node != null)
{
node.Attributes["value"].Value = this.TextBox1.Text;
xmlDom.Save((HttpContext.Current.Server.MapPath("web.config")));
}
}
注意:
<!--xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" 有此就不能修改RegisterID的值-->
<configuration>
<appSettings>
<add key="RegisterID" value="00:11:5B:9C:10:5C:12" />
</appSettings>
<configuration>
- 限制拷贝(绑定硬件)
- 使用udev 绑定硬件设备
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- Linux 多核下绑定硬件中断到不同 CPU(IRQ Affinity)
- 关于WEB程序硬件绑定的实现
- paip.提升安全性------本机硬件绑定
- 如何让软件绑定计算机硬件
- 如何让软件绑定计算机硬件
- JNI的使用和硬件绑定
- c# 绑定限制字符串长度的函数
- DataGridView绑定数据源后限制列显示
- JavaBean中的绑定属性与限制属性
- PHP 后期静态绑定之self::限制
- HTML Help Project (HHP) format—hhp文件格式
- Oracle exp/imp导出导入工具的使用
- 编写该多线程下载程序遇到的问题
- 1月16日 2007年的第一场雪
- 几首小诗
- 限制拷贝(绑定硬件)
- Linux下GNU开发环境的安装、sqlite-3.3.6的编译及调用sqlite数...
- F5公司的负载均衡解决方案
- 在DELPHI程序中使用ADO对象存取ODBC
- ultraedit 使用技巧
- js判断中英文字符串长度
- 一段分页代码PaginationSupport.java
- JSP工作原理
- 和时间恋爱,我喜欢她的微笑