This section describes how to obtain the complete URL of the current page by ASP. NET. icech makes it a function. Use it directly!
Private string GetPath (){String strPath = "http: //" + Request. ServerVariables ["HTTP_HOST"] + Request.
The string is defined by the class, as follows:
Public sealed class string: icomparable, icloneable, iconvertible, icomparable , ienumerable , ienumerable, iequatable
Note that it is derived from the ienumerable interface. If you want to get all
Using system;Using system. Web;Using system. text;
Namespace pub. Class{/// /// Requests operation class/// Public class request2 {# Region get/getint/getfloat/// /// Receive data transfer/// /// parameter name /// value corresponding to the
Compare compares the content of strings and determines whether some characters are equal based on the cultural background (location ).
CompareOrdinal is the same as Compare, but does not consider the cultural background.
Format: a string containing
MCT Maulik Patel from India provides a server-side IP retrieval Solution
If (context. Request. servervariables ["http_via"]! = NULL) // Using proxy{IP = context. Request. servervariables ["http_x_forwarded_for"]. tostring (); // return real client
There is no http_x_forwarded_for variable in request. servervariables. Only the remote_addr variable can be used, but both variables can obtain the Client IP address. So what is the difference between them?
Use request. servervariables
Request. servervariables ("script_name") is obtained on the serverDocument. Location. href is obtained from the client
-----------------------------------------------------------------------------
You can construct the URL of the current page as
Some experiences in system development[Structlayout (layoutkind. Sequential)]
Public struct memory_info
...{
Public uint dwlength;
Public uint dwmemoryload;
Public uint dwtotalphys;
Public uint dwavailphys;
Public uint dwtotalpagefile;
Public uint
Author: fallen leavesSource: http://www.cnsst.org/Usage: if it is less than 6.4, keep the default value. You only need to modify the command you want to execute! If the value is 6.4, enter 21 in "server side", and then enter the real IP address of
If it is not original, it will not be written.The idea of the article is to record the learning process ......There are no innovative things, and they are the things of their predecessors. My own summary ......There were a lot of holes in the system
When I was developing recently, I suddenly did not want others to collect data from my site, so I just wrote a piece of code.User_agent = request. servervariables ("http_user_agent ")Http_reffer = request. servervariables ("http_referer
The following functions are my summary over the years. Some of them are constantly summed up at work, and some are collected through some network routines. I hope these functions will be helpful to you, thank you!
'Custom formatdatetime function
Request. servervariables ("remote_addr") 'to obtain the access IP AddressRequest. servervariables ("local_addr") 'same as aboveRequest. servervariables ("SERVER_NAME") 'to obtain the Server IP AddressRequest. servervariables ("http_referer
Don't talk about anything, just give it to the original
Code
Copy code The Code is as follows: '========================================================== ==============================
'1. The name of the folder where the website is located
Recently, our website encountered the problem of SQL injection, which may be caused by a large number of people who are interested in the website, or some people who are in disorder. The database is always injected with malicious code, which makes
The Client IP address needs to be obtained in the project, and relevant information is searched on the Internet. Here I will summarize some of my usage.For future reference.Generally, we obtain the IP address through the following code:String IP =
We use request. servervariables ("remote_addr") to obtain the IP address of the client,
However, if the client is accessed by a proxy server, the IP address of the proxy server is obtained, rather than the real IP address of the client.
To
/** //
/// Obtain the real IP address of the client. If a proxy exists, the first non-Intranet address is used.
///
Public static string IPAddress
{
Get
{
String result = String. Empty;
Result = HttpContext. Current. Request. ServerVariables
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
%
Dim
SQL _leaching, SQL _leach_0, SQL _data, IP, brown
'
Add the special characters ------------------------------------------------------
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.