There is a need to locate the user's city based on the user's IP address.This article is a documented article, without logic. Friends with such needs can be copied directly to use. Directly on the code, do not need to repeat.Results:Using Sina's Open API, the execution speed is still very great.This article is from CSDN, reprint please mark the source! http://blog.csdn.net/liruxing1715/article/details/28238
This article mainly introduces PHP based on IP to determine the region name information method, the need for friends can refer to the following See Code nbsp; nbsp; code as follows: ;city;nbsp; nbsp; with Object data
Note point: vs to set HTTP Profile:none->http
Implementation requirements: The same portal IP is forwarded to different servers based on different port implementations
Implementation principle: Set the rules on VS, use rules to forward packet implementations
Rule example:
When client_accepted {
if {[Tcp::local_port] equals ' 8089 '} {
Pool chicago_pool_8089
} else {
Pool chicago_pool_80
}
}
The a
Asp.net| Weather Forecast
Visit www.163.com, the first page of the column has the local weather forecast. It can be guessed that the weather forecast here should be based on the caller's IP to determine the location of the local weather conditions. Asked some friends, also confirmed this point. The project also needs weather forecast this small column, the colleague has done one (from other sites to crawl),
Native IP eth0:192.168.244.150 eth0:0 192.168.244.158
1, based on the same IP different port virtualhost
Edit httpd.conf New Configuration entry
Vim/etc/httpd/conf/httpd.conf
Listen 8080
Listen 8888
In the following new
Documentroot/var/www/html/website1
Documentroot/var/www/html/website2
To create a directory:
Mkdir/var/www/html/website1
Mkdir
Under Linux, there is a tool called Nslookup, which uses the reverse DNS protocol to query the IP address for the corresponding hostname.Like what:Nslookup 10.0.0.5You can query the corresponding hostname for this IP.Nslookup hongchangfirst.amazon.comThe IP corresponding to this hostname can be queried.According to hostname how to query IP, directly ping can be d
Visit www.163.com, the first page of the column has the local weather forecast. It can be guessed that the weather forecast here should be based on the caller's IP to determine the location of the local weather conditions. Asked some friends, also confirmed this point. The project also needs weather forecast this small column, the colleague has done one (from other sites to crawl), but cannot realize accord
/** * Get broadcast address * */public static String getbroadcastaddress (string subnet, string IP) {string[] ips = ip.split ("\ \."); string[] subnets = subnet.split ("\ \"); StringBuffer sb = new StringBuffer (), for (int i = 0; i Get the Java implementation of the broadcast address based on the IP address and subnet mask
Break;fputs(buf, stdout); Fflush (stdout); }//Send the last string to the server fputs("from Client:thank you! \ n ", WRITEFP); Fflush (WRITEFP);//semi-closed shutdown is mainly used for the service side, the customer service directly close the general will not have any impact (study note _10)Fclose (WRITEFP); Fclose (READFP);return 0;}voidError_handling (Char*message) {fputs(message, stderr); FPUTC (' \ n ', stderr);Exit(1);} Copyright NOTICE: This article for Bo Master origi
This article describes the Python implementation method that obtains all IP addresses based on the host name. Share to everyone for your reference. The implementation methods are as follows:
?
1 2 3 4 5 6 7
#-*-coding:utf-8-*-Import sys, socket result = Socket.getaddrinfo (' www.google.com ', None, 0, socket. SOCK_STREAM) counter = 0 for item in Result:print "%-2d:%s"% (counter, item[4]) c
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.