下载一个.net ajax开发包,该开发包包括asp2.0与目前asp1.1版使用的ajax,详细地址参见http://ajax.schwarz-interactive.de/,接下来,开始。
1. 新建一个项目,在引用中添加引用ajax.dll,ajax.dll位于下载的压缩包里面。
<configuration> 【相关文章:内容安全相关网络设备功能介绍】
2.建立httphandler,在web.config里面加上 【扩展阅读:一体化的网络安全——SINFOR UTM】
【扩展信息:金盾抗DDOS系统的技术优势】 <system.web> <httphandlers> <add verb="post,get" path="ajax/*.ashx" type="ajax.pagehandlerfactory, ajax" /> </httphandlers><system.web>
</configuration>3.新建一个类demomethods,这个类实现获取客户端mac地址:
using system;
using system.web;namespace ajaxsample
{ /**//// <summary> /// summary description for methods. /// </summary> public class demomethods {[ajax.ajaxmethod]
public string getcustomermac(string clientip) //这里输入客户端ip,这个函数知识测试用,你也可以写一个其他的简单一点的函数代替 { string mac = "";system.diagnostics.process process = new system.diagnostics.process();
process.startinfo.filename = "nbtstat"; ... 下一页