如何解决Tcpip上的NetBIOS问题。 。 。 。 。 。 。 。 :已禁用的问题 [英] How to solved NetBIOS over Tcpip. . . . . . . . : Disabled problem

查看:650
本文介绍了如何解决Tcpip上的NetBIOS问题。 。 。 。 。 。 。 。 :已禁用的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends,

我使用php代码访问mac地址。

但显示此错误:NetBIOS over Tcpip。 。 。 。 。 。 。 。 :残疾人

请给出你的建议。



Hello Friends,
I am access mac address using php code.
But display this error : NetBIOS over Tcpip. . . . . . . . : Disabled
please give your suggestion.

<?php
/**
access to network card MAC address of the original code; Currently supported Windows/LINUX system
get the machine card physical (MAC) address
**/
class GetMacAddr
{
var $return_array=array();//returns an array of strings with the MAC address
var $mac_addr;
function GetMacAddr ($os_type) {
switch ($os_type) {
case "Linux" :
$this -> ForLinux();
break;
case "solaris" :
break;
case "Unix" :
break;
case "wins" :
$this -> ForWindows();
break;
default:
 echo"plz select os";
break;

} $temp_array=array();
foreach ($this ->return_array as $value) {
if (
preg_match("/[0-9 a - f] [0-9] a - f [-] ". "[0-9 a - f] [0-9] a - f [-]". "[0-9 a - f] [0-9] a - f [-]". "[0-9 a - f] [0-9] a - f [-]". "[0-9 a - f] [0-9] a - f [-]". "[0-9 a - f] [0-9] a - f/I", $value,
$temp_array)) {
$this ->Mac_addr=$temp_array [0];
break;

}}
unset ($temp_array);
return $this ->Mac_addr;

} function forWindows () {
	//echo "wisn";
@exec("ipconfig/all", $this ->return_array);// interchange to echo instead of @ then display //error. 
if ($this -> return_array)
return $this ->Return_array;
else {
$ipconfig=$_SERVER["WINDIR"]."\system32\ipconfig.exe";
if (is_file ($ipconfig))
echo exec($ipconfig."/all", $this ->return_array);
else
@exec($_SERVER["WINDIR"]."\system\ipconfig.exe/all", $this -> return_array);
return $this -> Return_array;
}}
function forLinux () {
@exec("ifconfig -a", $this ->return_array);
return $this ->Return_array;

}}

//method using the
$MAC=new GetMacAddr("wins");

print_r($MAC ->Mac_addr);

?>

推荐答案

return_array = array(); // 返回MAC地址
var <的字符串数组span class =code-sdkkeyword>
return_array=array();//returns an array of strings with the MAC address var


mac_addr ;
函数GetMacAddr(
mac_addr; function GetMacAddr (


os_type){
switch(
os_type) { switch (


这篇关于如何解决Tcpip上的NetBIOS问题。 。 。 。 。 。 。 。 :已禁用的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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