public partial class _111111111 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string dirResults = "";
ProcessStartInfo psi = new ProcessStartInfo();
Process proc = new Process();
psi.FileName = "nbtstat";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = "-A " + Request.ServerVariables["REMOTE_ADDR"];
psi.UseShellExecute = false;
proc = Process.Start(psi);
dirResults = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
dirResults = dirResults.Replace("\r", "").Replace("\n", "").Replace("\t", ""); Regex reg = new Regex("Mac[ ]{0,}Address[ ]{0,}=[ ]{0,}(?((.)*?)) __MAC", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Match mc = reg.Match(dirResults + "__MAC"); if (mc.Success)
{
this.Label1.Text = mc.Groups["key"].Value;
return;
}
else
{
reg = new Regex("Host not found", RegexOptions.IgnoreCase | RegexOptions.Compiled);
mc = reg.Match(dirResults);
if (mc.Success)
{
this.Label1.Text = "Host not found!";
return ;
}
else
{
this.Label1.Text = "";
return ;
}
} }
}
{
protected void Page_Load(object sender, EventArgs e)
{
string dirResults = "";
ProcessStartInfo psi = new ProcessStartInfo();
Process proc = new Process();
psi.FileName = "nbtstat";
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.Arguments = "-A " + Request.ServerVariables["REMOTE_ADDR"];
psi.UseShellExecute = false;
proc = Process.Start(psi);
dirResults = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
dirResults = dirResults.Replace("\r", "").Replace("\n", "").Replace("\t", ""); Regex reg = new Regex("Mac[ ]{0,}Address[ ]{0,}=[ ]{0,}(?((.)*?)) __MAC", RegexOptions.IgnoreCase | RegexOptions.Compiled);
Match mc = reg.Match(dirResults + "__MAC"); if (mc.Success)
{
this.Label1.Text = mc.Groups["key"].Value;
return;
}
else
{
reg = new Regex("Host not found", RegexOptions.IgnoreCase | RegexOptions.Compiled);
mc = reg.Match(dirResults);
if (mc.Success)
{
this.Label1.Text = "Host not found!";
return ;
}
else
{
this.Label1.Text = "";
return ;
}
} }
}
解决方案 »
- 请好心人帮忙,哪有ASP.NET程序的开源代码.好好学习下!
- 如何得到客户端的网卡号?
- sql 注入 iis日志信息 求高人分析
- [100分在线等]如何指定OracleDataAdapter的InsertCommand、UpdateCommand等,才能使用Update(DataTable)方法?
- 急切的:请问如何在IIS中设置站点的物理内存/虚拟内存及站点的连结数
- 弱弱的问:页面记录访问用户信息写入同一个文件,会不会产生冲突
- 控件继承的问题
- 关于中文字符串的问题search?q=%E8%AE%BA%E5%9D%9
- 使用 属性生成器 来设置 datagird 的一个 超级联接列 ,其中我 文本字段是title,如何URL字段呢
- asp(.net)源码是怎样被下载的?(200分送上)
- asp.net+FCK文本编辑器发布问题 求救.
- 一般处理程序上传文件的问题..
你写后台写的再牛拿到的也是服务器的MAC