Nginx configuration stepsGo to the conf directory under the nginx installation directory and save the following code as agent_deny.conf.# Cd/usr/local/nginx/conf# Vi agent_deny.conf# Prohibit Scrapy and other tools from capturingIf ($ http_user_agent ~ * (Scrapy | Curl | HttpClient )){Return 403;}# Prohibit access with null UA and UA valuesIf ($ http_user_agent ~ "WinHttp | WebZIP | FetchURL | node-sup
GetCookie () As System. Net. CookieCollectionReturn m_cookiesEnd FunctionEnd Class
Simple get Functions
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Public Function GetPage (ByVal url As String) As String
Dim hRqst As HttpWebRequest = HttpWebRequest. Create (url)
HRqst. ContentType = "application/x-www-form-urlencoded"HRqst. Method = "GET"Dim streamData As Stream
Dim hRsp As HttpWebResponse = hRqst. GetResponse ()StreamData = hRsp. Get
These two days to make a judgment of the browser type and version number of the business, record the relevant JS code:
Copy Code code as follows:
function Allinfo () {
var ua = navigator.useragent;
UA = Ua.tolowercase ();
var match =/(WebKit) [\/] ([\w.] +)/.exec (UA) | |
/(opera) (?:. *version)? [ \/] ([\w.] +)/.exec (
Requirements: Profile sharing under Windows, different permissions for different users, such as:
Environment:
Windows Server 2003
There are 4 users (UserA, UserB, UserC, UserD)
There are 4 folder directories (UA, UB, UC, UD)
Demand:
UserA can access only files in the UA directory and write permissions in the UA directory.
UserB can only access files in the
Error:concurrent map read and map write may appearThe following is an example of an unsafe map:
Type userages struct {
ages map[string]int
sync. Mutex
}
func (UA *userages) ADD (name string, age int) {
ua. Lock ()
defer UA. Unlock ()
ua.ages[name] = Age
}
func (UA *userages) Get (name string) int {
After Insurance, add a sentence If the page needs to be the default speed core, add tag: If the page needs to default IE compatible kernel, add tag: If the page needs to default with IE standard kernel, add tag: http-equiv="X-ua-compatible" content="Ie=7" >#以上代码告诉IE浏览器, IE8/9 will render the page with the IE7 engine, regardless of whether the document standard is declared with a DTD. http-equiv= "x-ua-compa
time
Now:function () {
Return (new Date ()). GetTime ();
},
Use the Jquery.browser is frowned upon.
More Details:http://docs.jquery.com/utilities/jquery.browser
Do not favor the use of Jquery.browser, recommend the use of Jquery.support
Navigator information for the browser in use
Navigator.useragent a read-only string that declares the value of the user agent header used by the browser for the HTPP request
Uamatch:function (UA) {
Copy Code code as follows:
UserAgent REGEXP
Rwebkit =/(WebKit) [\/] ([\w.] +)/,
Ropera =/(opera) (?:. *version)? [ \/] ([\w.] +)/,
Rmsie =/(MSIE) ([\w.] +)/,
Rmozilla =/(Mozilla) (?:. *? RV: ([\w.] +))?/,
Keep a useragent string for use with Jquery.browser
useragent = Navigator.useragent,
For matching the engine and version of the browser
Browsermatch,
Use the Jquery.browser is frowned upon.
More Details:http://docs.jquery.com/utilities/jquery.browser
Uamatch:function (
Because of the Windows XP patch SP2, the security of the IE6 has also done a lot of promotion, so that there are a lot of original functions we can use, it will become very strange or even off the vegetables: (. In particular, pop-ups, modal windows, and popup windows are significantly affected. So can I tell if the user is using the IE6 is ordinary IE6 (IE6SP1) or IE6+XP SP2?
Here are two more typical IE6 browser useragent fields:
1, Windows XP + SP1 (NT 5.1)
Connection:keep-alive
Accept: */*
only gets the header of the document from the server*post sending data to the server that needs to be processed*trace tracks messages that may be routed to the server through a proxy server. The mediation receives a trace request to add its own host address to the VIA header of the message. The destination host sends back the received message in the entity that responds, so that the client can determine whether the request has been modified by the mediation.*options Ask the server if some metho
some information on the Internet and finally found the onpropertychange event. This event will not be triggered in FF. In IE, when the checkbox selection status changes, it will start immediately. Therefore, the final solution is obtained: in IE, bind the onpropertychange event to the checkbox, and in FF, bind the onchange event to it.
The Code is as follows:Copy codeThe Code is as follows:Var ua = navigator. userAgent. toLowerCase ();Var s = null;Va
In general, we can direct the URL to a file under DocumentRoot to guide the user to download the file. However, in this way, there is no way to do some statistics, permission checks, and so on. therefore, we often use PHP for forwarding to provide users with file downloads.
The code is as follows:
$ File = "/tmp/dummy.tar.gz ";
Header ("Content-type: application/octet-stream ");
Header ('content-Disposition: attachment; filename = "'. basename ($ file ).'"');
Header ("Content-Length:". filesi
PHP allows users to download files faster. In general, we can direct the URL to a file under DocumentRoot to guide users to download the file. However, in this way, we can't make some statistics. In general, we can direct the URL to a file under the Document Root to guide the user.
Download Files.
However, in this way, you cannot perform statistics, permission checks, and so on. Therefore, we often usePHPFor the userDownload Files.
$ File = "/tmp/dummy.tar.gz ";
Header ("Content-type: applicati
PHP provides faster code for file download. However, in this way, we can't do some statistics, permission checks, and so on. therefore, we often use PHP for forwarding to provide users with file downloads. copy the code, for example, but, in this way, there is no way to do some statistics, permission checks, and so on. therefore, we often use PHP for forwarding to provide users with file downloads.
The code is as follows:
$ File = "/tmp/dummy.tar.gz ";Header ("Content-type: application/octe
immediately. However, the second problem is encountered.
Question ②:When the onclick event and this. blur are both used, an error is reported in IE.
I found some information on the Internet and finally found the onpropertychange event. This event will not be triggered in FF. In IE, when the checkbox selection status changes, it will start immediately. Therefore, the final solution is obtained: in IE, bind the onpropertychange event to the checkbox, and in FF, bind the onchange event to it.
The
The getYear () function is not recommended long ago, because it is incorrectly displayed in Firefox, And the getFullYear () function is recommended.Firefox does not support the innerText attribute. You need to change it to textContent to receive the message.Then, attach the codeCopy codeThe Code is as follows:Var s, Sys ={}, ua = window. navigator. userAgent. toLowerCase ();(S = ua. match (/msie ([\ d.] + )
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.