C# asp.net macaddr
<HTML><HEAD><TITLE>WMI Scripting HTML</TITLE>
<META http-equiv=Content-Type c>
<SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, pAsyncContext)" for=foo>
var MACaddress=unescape(MACAddr);
alert(MACaddress);
document.forms[0].txtMACAddr.value=unescape(MACAddr);
//document.formbar.submit();
</SCRIPT>
<META c name=GENERATOR></HEAD>
<BODY>
<SCRIPT language=JScript event=OnObjectReady(objObject,objAsyncContext) for=foo>
if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined" && objObject.IPEnabled == true){
if(objObject.MACAddress != null && objObject.MACAddress != "undefined")
MACAddr = objObject.MACAddress;
}
</SCRIPT>
<OBJECT id=locator classid=CLSID:76A64158-CB41-11D1-8B02-00600806D9B6 VIEWASTEXT></OBJECT>
<OBJECT id=foo classid=CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223></OBJECT>
<SCRIPT language=JScript>
var service = locator.ConnectServer();
var MACAddr ;
service.Security_.ImpersonationLevel=3;
service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
</SCRIPT>
<FORM id="formfoo" name="formbar" method="post"><INPUT value="77" name="txtMACAddr">
</FORM></BODY></HTML>
相关文档:
URL:
http://www.cnblogs.com/JimmyZhang/archive/2007/09/04/880967.html
引言
我查阅过不少Asp.Net的书籍,发现大多数作者都是站在一个比较高的层次上讲解Asp.Net。他们耐心、细致地告诉你如何一步步拖放控件、设置控件属性、编写CodeBehind代码,以实现某个特定的功能。
这种做法,实际上是回答了“如何去做&rd ......
//平常调用javascript方法
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert'Weclome!!!');</script>");
背景不为白色的方法:
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('添加失败,请联系技术员!') ......
asp.net(C#)实现SQL2000数据库备份和还原
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.Htm ......
URL 重写是截取传入 Web 请求并自动将请求重定向到其他 URL 的过程。
比如浏览器发来请求hostname/101.aspx ,服务器自动将这个请求中定向为http://hostname/list.aspx?id=101。
url重写的优点在于:
缩短url,隐藏实际路径提高安全性
易于用户记忆和键入。
&nbs ......
System.Drawing.Image watermark = System.Drawing.Image.fromFile(Server.MapPath("watermark.gif"));
Bitmap srcImg = new Bitmap(Server.MapPath("example.jpg"));
Graphics graphics = Graphics.fromImage(srcImg);
graphics.DrawImage(watermark,
srcImg.Width - watermark.Width,
srcImg.Height - w ......