First, the use of JS to obtain the client IP several methodsMethod one (only for IE and the client's IE allows Acitivex to run, through the platform: xp,server03,2000).Get the client IP code:Get IP:Method Two (all platforms and browsers):Get the IP that the client is in the network, provided that the customer is networked. The Sina interface is used. Method Three (all platforms and browsers):Sohu Interface
"));//Get User nameSystem.out.println (Map.get ("COMPUTERNAME"));//Get Computer nameSystem.out.println (Map.get ("UserDomain"));//Get computer domain name}Get the computer's IP address and MAC addresspublic static mapMaptry{InetAddress a
In many cases, we need to obtain server hardware information (such as MAC address), commonly used in several ways:• Use a command-line program to get the hard drive information, and then get the output stream via Runtime.getruntime (). exec, then get the MAC address via stri
PHP $_server[' php_self ']$_server[' Php_self ') represents the location address of the current PHP file relative to the root of the Web site, and is related to document root.Suppose we have the following URLs, $_server[' php_self ') results are:http://www.5idev.com/php/:/php/index.phphttp://www.5idev.com/php/index.php:/php/index.phphttp://www.5idev.com/ Php/index.php?test=foo:/php/index.phphttp://www.5idev.com/php/index.php/test/foo:/php/index.php/te
How to get the Address bar parameters using JS (super Simple)Method One: Use regular expressions to get the address bar parameters: (highly recommended, both practical and convenient!) )
functionGetQueryString(name){varreg = newRegExp("(^|)"+ name +"=([^]*)(|$)");varr = window.location.search.substr(1).mat
How to get the Address bar parameters using JS (super Simple)Method One: Use regular expressions to get the address bar parameters: (highly recommended, both practical and convenient!) )
functionGetQueryString(name){varreg = newRegExp("(^|)"+ name +"=([^]*)(|$)");varr = window.location.search.substr(1).mat
There are many ways to get the MAC address of the computer network card, which is obtained by command line , can get the MAC address of the Wired NIC and the wireless card, very simple, directOn the code."1" header file#if!defined (afx_95644697_c78f_4dd6_885b_3d7c40b2d55c__included_) #define Afx_95644697_c78f_4dd6_885b
script, use the virtual machine time to do a prior start on the OK.
Third, otherToday I got an XP virtual machine, the network is set to bridge mode, how can not get IP address, network connection is limited. After many tests finally solved the problem, share to everyone.
Virtual machine environment: VMware? Workstation 8.0.1 build-528992
Installed virtual machine: Windows XP This system was previously u
IP address in. NET to get a computer name, IP address and the current user name is very simple, the following is a few of my common methods, if you have other good methods, you can reply together:
1. Special properties in asp.net:
Get Server computer name: Page.Server.ManchineName
In the C language, everyone must be familiar with the symbol.
In addition to bitwise operations, it also provides more common functions-getting variable addresses.
Let's take a look at the following simple example:
# Include
Int main (void)
{
Int A = 0;
Int * P = ;
Printf ("the value is: % d/N", * P );
Return 0;
}
In the above Code, the pointer P points to the address of variable. In C/C ++, each variable has its corresponding
Method One: Use regular expressions to get the address bar parameters: (highly recommended, both practical and convenient!) )
function GetQueryString(name){var reg = new RegExp("(^|)"+ name +"=([^]*)(|$)");var r = window.location.search.substr(1).match(reg);if(r!=null)returnunescape(r[2]); return null;}// 调用方法alert(GetQueryString("参数名1"));alert(GetQueryString("参数名2"));alert(GetQueryString("参数名3
Method One: Use regular expressions to get the address bar parameters: (highly recommended, both practical and convenient!) )?
function GetQueryString(name){var reg = new RegExp("(^|)"+ name +"=([^]*)(|$)");var r = window.location.search.substr(1).match(reg);if(r!=null)returnunescape(r[2]); return null;}// 调用方法alert(GetQueryString("参数名1"));alert(GetQueryString("参数名2"));alert(GetQueryString("参数名
Method One: Use regular expressions to get the address bar parameters: (highly recommended, both practical and convenient!) )
functionGetQueryString(name){varreg = newRegExp("(^|)"+ name +"=([^]*)(|$)");varr = window.location.search.substr(1).match(reg);if(r!=null)returnunescape(r[2]); returnnull;}// 调用方法alert(GetQueryString("参数名1"));alert(GetQueryString("参数名2"));alert(GetQueryString("参数名3"));
Front-end Nginx, backend Apache get user real IP addressRecently in the Apache-2.2 and Apache-2.4 added to the LNMP one-click installation package, Nginx as the front end, Apache as the back end of the case, Apache can only get to the Nginx front-end IP address (127.0.0.1), and unable to obtain the user's real IP address
PHP Gets the image address in the CSS file and downloads it to the local method,
This example describes how PHP gets the image address in the CSS file and downloads it locally. Share to everyone for your reference.
The specific implementation code is as follows:
The copy Code code is as follows: /** * get picture addre
in the JSP, the method to obtain the IP address of the client is: Request.getremoteaddr (), which is valid in most cases. However, after passing the reverse proxy software such as Apache,squid,nginx, due to the addition of the middle tier between the client and the service, So the IP that the Request.getremoteaddr () method obtains is actually the address of the proxy server, not the IP
an array that contains IP information
String []
Whether
For example: count=2, which indicates an array length of 2 (0,1)
STRAREA_IP[0]
IP address requested by the client
String
Whether
For example: "218.108.242.108"
STRAREA_IP[1]
IP Address Region information
String
Whether
For example: "Hangzhou, Zhejiang"
Get a URL address in PHP I will use the Super global variable $_server, he includes a variety of parameters, such as Http_host, php_self, query_string, etc., here is not introduced.
PHP gets the URL of a few functions introduced
The code is as follows
Copy Code
Get domain name or host addressecho $_server[' Http_host ']. "";
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.