WebService obtains the server hardware information and Client IP address, MAC address, and browser information, and the city in which the server resides --Using System;Using System. Collections;Using System. ComponentModel;Using System. Data;Using System. Diagnostics;Using System. Web;Using System. Web. Services;Using System. Web. UI;Using System. Web. UI. WebControls;Using System. Web. UI. HtmlControls;Usi
A few days ago, someone asked me how to get the MAC address of the client in ASP. NET. I didn't think much about it at the time. I gave him a piece of code, as shown below:
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->[DllImport ("Iphlpapi. dll")]
Private static extern int SendARP (Int32 dest, Int32 host, ref Int64
The mac address is the NIC address. Generally, the user's mac address location cannot be obtained, because the security limits the browser, so it is almost impossible to get it. Below we will take two pieces of code for you to play.
Example 1
PHP code:
The Code is as follows:
Copy code
@ Exec ("arp-a", $ array); // run the arp-a command and put the result in the array $ array.Echo "P
There are about three methods to obtain the MAC address of the client (IE) Nic from Java/JSP.
1. Execute ipconfig on the client using commands.
2. ActiveX Method
3. How to send query commands to port 137
Introduction:
The first method is to block the command that does not know why the MAC address is obtained when it i
Address: http://www.myexception.cn/program/1399860.htmlDowngrading and testing the client and some code annotations of the dark world on MAC (based on Firefly)
Downgrading and testing the client and some code annotations in the dark world on MAC (based on Firefly)
Currently there are two clients, one based on cocos2d-x
Example 1
PHP Code:
The code is as follows
Copy Code
@exec ("Arp-a", $array); Executes the ARP-A command, and the result is placed in the array $arrayecho "Print_r ($array); Print fetched arrayforeach ($array as $value){if (//match result put to array $mac_arrayStrpos ($value, $_server["REMOTE_ADDR"]) Preg_match ("/(:? [ 0-9a-f]{2}[:-]) {5}[0-9a-f]{2}/i ", $value, $mac _array)){$mac
In a B/S system, we often need to obtain some information about the client, such as IP and MAC, for identity authentication. In ASP. NET, it is easy to get the MAC address of the server, but it is really easy to get the MAC address of the client. The common practice is to ca
In a B/S system, we often need to obtain some information about the client, such as IP and MAC, for identity authentication. It is easy to obtain the MAC address of the server, but it takes too much effort to obtain the MAC address of the client. The common practice is to ca
In a B/S system, we often need to obtain some information about the client, such as IP and Mac, for identity authentication. In ASP. net, it is easy to get the MAC address of the server, but it is really easy to get the MAC address of the client. The common practice is to ca
In a B/S system, we often need to obtain some information about the client, such as IP and Mac, for identity authentication. In ASP. net, it is easy to get the MAC address of the server, but it is really easy to get the MAC address of the client. The common practice is to ca
In the B/s structure of the system, we often need to obtain some information on the client, such as IP and Mac, in conjunction with authentication. In ASP.net, it's easy to get a server-side Mac, but it takes a lot of effort to get the MAC address of the client, usually by c
Method 1:
Call the Windows doscommand to read the MAC address from the output:
Public static string getmacaddress (){
String address = "";String OS = system. getproperty ("OS. Name ");If (OS! = NULL OS. startswith ("Windows ")){Try {String command = "cmd.exe/C ipconfig/all ";PROCESS p = runtime.getruntime(cmd.exe C (command );Bufferedreader BR =New bufferedreader (New inputstreamreader (P. getinputstream ()));String line;While (line = Br. Readl
For the most part, it is possible to use the ActiveX control method, but this scenario applies only to IE browsers. In order to be compatible with different browsers, such as Firefox, we need to consider a more general approach. This method we can refer to "in many sites, will be in a page somewhere to a link to directly start QQ to chat." This method enables the Web system to invoke an EXE file on the client computer (provided that the required EXE a
In the B/s structure of the system, we often need to obtain some information on the client, such as IP and Mac, in conjunction with authentication. Getting a server-side Mac is easy, but getting the client's MAC address takes a lot of effort, usually by calling Win32API or calling the nbtstat command directly, which ha
In a real-world Web application, we may encounter a "need to qualify a specific computer or user to use the system" issue.As a general rule, the most likely use of ActiveX controls is to implement them, but this scenario is only applicable to IE. In order to be compatible with different browsers, such as Firefox, we need to consider a more general approach. This method we can refer to "in many sites, will be a link in the page somewhere to start QQ directly to chat." This approach enables the We
Tengda router settings --Client Filter
Procedure:
1) log onto the tengda router interface and click "Advanced Settings" in the upper right corner,
2) on the Advanced Settings page, click "Security Settings" -- "client filter ":
In this example, the IP address range 192.168.0.100 -- 192.168.0.120 is prohibited from accessing the Internet .:
Tengda router settings-
To obtain the MAC of the client, the web server must be in the same lan network segment. Since it is already in the same network segment, the subnet mask and gateway are the same; therefore, you can only obtain the Client IP to Mac conversion process. If the lan mac has regi
Usually office use Mac client more, their own 163 and Gmail are in the Mac down to send and receive mail, also accustomed to the layout of Mac Mail, in the new company configuration office mailbox, suddenly appeared in the office mailbox can only accept, can not send embarrassing situation .....First introduce the gene
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.