PHP obtains the MAC address
Obtain the physical (MAC) Address of the machine Nic.Code:
.The Code is as follows:
/**
* Obtain the physical (MAC) Address of the machine Nic
* Currently, Windows/LINUX systems are supported.
**/
Class MacAddInfo {
Var $ return_array = array (); // returns a string array with a MAC address.
Var $ mac_addr;
Function MacAddInfo ($ OS _type ){
Switch (strtolower ($ OS _type )){
Case "linux ":
$ This-> forLinux ();
Break;
Case "solaris ":
Break;
Case "unix ":
Break;
C
need to check the DNS address used by our computer, and query the running status of the instance.1. Open start> Run> enter CMD in win7 and press enter to enter command line mode;2. Enter the ipconfig/all command to query network parameters.3. In the ipconfig/all display information, we can see that "DNS server" is the address of our DNS server. Step 4: If your company's internal network addre
command line mode.
Step 2: Enter the ipconfig/all command to query network parameters.
Step 3: In the ipconfig/all display information, we can see a place where DNS servers is written. This is the address of our DNS server. For example, the author is 202.106.0.20 and 202.106.46.151. It can be seen from this address that it is an Internet address. If an Internet DNS resolution error occurs, we can replace a
Tag: Using line host read flush win 127.0.0.1 STD UseSecond, the application Example Analysis 2.1 subprocess module use 1. Subprocess.call>>> subprocess.call (["LS", "-l"])0>>> Subprocess.call ("Exit 1", shell=true)12. Invoke the cmd command in the system to display the results of the command execution:X=subprocess.check_output (["echo", "Hello world!"],shell=true)Print (x)"Hello world!"3. Display the contents of the file in Python:Y=subprocess.check_output (["Type", "App2.cpp"],shell=true)Print
, and the text displayed in the adapter address bar is the MAC address of the NIC, and the ipconfig command with the "all" parameter is run at the DOS prompt of the Winnt system. That is, Ipconfig/all can also display the MAC address of the NIC.
2, the remote test computer MAC address: For network administrators, you can use the Tcpnetview tool software to realize sitting in front of their own computer can
Students dormitory necessary LAN testing tools, we set up a dormitory in the dormitory network: A: Some games need TCP/IP protocol support, some need IPX protocol support, LAN connectivity testing tools are necessary to form a dormitory network, everyone in the search for the establishment of the dormitory network keyword, is to understand the LAN connectivity test tool to build a dormitory network necessary problems. Build dormitory Network related knowledge: It is often used to detect whether
Reason: Some time ago, a friend unit LAN appeared a little problem to me to help look. According to friends, the recent units in some sections of the computer frequently appear to be unable to surf the phenomenon. Ask a friend to know that these computers are open DHCP services, automatic access to IP, after the investigation of their gateway address has been found to have problems. The correct address should be 192.168.4.254, and these failed computers get a gateway address of 192.168.4.65. Aft
What actions occur when I click Repair on a network connection in Windows XP and later?
A.If you right-click a network connection and select Status, Windows displays information about the connection ' s speed, duRation of connection, and packet activity.For XP and later, a Repair option appears on the Support tab.When you click Repair, Windows attempts to resolve a range of problems. Specifically, the OS
Attempts to renew the DHCP lease, if the connection obtains its IP addresses through DHCP,
/**
Obtain the MAC address origin of the NIC; currently supports Win/linux system
Get the physical (MAC) address of the machine's network card
**/
Class getmacaddr{
var $return _array = Array (); Returns an array of strings with a MAC address
var $mac _addr;
function getmacaddr ($os _type) {
Switch (Strtolower ($os _type)) {
Case "Linux":
$this->forlinux ();
Break
Case "Solaris":
Break
Case "UNIX":
Break
Case "AIX":
Break
Default
$this->forwindows ();
Break
}
$temp _array = Array ();
forea
Copy Code code as follows:
:: Get the NIC name with the Ipconfig/all command.
for/f "tokens=2*"%%i in (' ipconfig/all^|find/i "Ethernet adapter" ') do set name=%%j
:: Remove the colon after the network card name with the for command.
for/f "tokens=1* delims=:"%%i in ("%name%") do set network card name =%%i
Apply the above script to modify DNS, such as the national DNS server crashed y
not access, then DNS resolution should not be normal. We will receive a message from DNS request timed Out,timeout was 2 seconds. This means that our computer does have a DNS resolution problem.
Tip: If DNS parsing is normal, feedback back to the correct IP address, such as the author with www.sohu.com this address for query resolution, will get name:sohu.com,addresses:61.135.133.103, 61.135.133.104 of information.
(2) Query the DNS server is working properly:
At this point we will look at t
Refreshing the DNS cache only needs to be refreshed by using the command to flush the DNS cache. So what is the command to flush the DNS cache? is "Ipconfig/flushdns". The specific steps are as follows:
First, hold down the keyboard win+r key combination, open a running window, then enter the "CMD" command on the Run window, execute the command to open a command prompt window. As shown in the figure:
Step two, and then at the command prompt t
Ipconfig/all command to query the network parameters.
Step three: In Ipconfig/all display information we can see a place that says DNS SERVERS ("DNS Server" is displayed under Vista or Win7), this is our DNS server address. For example, the author is 202.106.0.20 and 202.106.46.151. From this address can be seen as an extranet address, if the use of extranet DNS resolution error, we can replace a differen
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.