C# 클래스 Argentini.Halide.H3Http

The H3Http class contains methods and properties for performing or evaluating HTTP operations. This includes cookies, domain redirection, and more.
파일 보기 프로젝트 열기: argentini/Halide

공개 메소드들

메소드 설명
AddCrossBrowserClientRedirect ( Page pageToAddScriptTo, String url ) : void

Add a cross browser compliant client side redirect (which ensures that the Referrer value will be not null on the subsequent page) with a zero second delay.

AddCrossBrowserClientRedirect ( Page pageToAddScriptTo, String url, Int32 seconds ) : void

Add a cross browser compliant client side redirect (which ensures that the Referrer value will be not null on the subsequent page).

AddUrlParamPrefix ( String urlParams ) : String

When passed a URL parameter list, it is returned with the leading "?", or as a blank string if there are no parameters. This method is used to ensure that a URL parameter list starts with a "?".

DeleteUrlParameter ( String urlParam ) : String

Remove a URL parameter from the current URL parameter list and return the new request string.

DeleteUrlParameter ( String urlParam, String urlParameterString ) : String

Remove a URL parameter and return the new request string.

DomainRedirect ( String defaultPageName, String domainName ) : String

Determine if the user needs to be redirected to a new URL, for sites that have multiple domain names, but one primary (e.g. like catching misspellings in domain names). The transport (e.g. http://) is not used or returned with the result of the method.

GetBrowser ( String userAgent ) : String

Return the browser name and version.

GetBrowser ( String userAgent, System.Int64 &majorVersion, System.Int64 &minorVersion, System.Int64 &buildVersion, String &browserName ) : String

Return the browser name and version.

GetBrowserMajorVersion ( ) : String

Return the browser major version number.

GetBrowserMinorVersion ( ) : String

Return the browser minor version number.

GetBrowserName ( ) : String

Return the browser name.

GetBrowserVersion ( String browserName ) : Double

Return the version of specific browser based on HTTP headers or -1 if the request came from another browser.

GetCurrentPageName ( ) : String

Retrieve the current page file name on disk.

GetFirefoxVersion ( ) : Double

Return the version of Mozilla Firefox being used or -1 if the request came from another browser.

GetHost ( ) : String

Get the fully qualified domain name of the current URL.

GetHostRoot ( ) : String

Get the root domain from the fully qualified domain name of the current URL. (e.g. if visiting "www.mydomain.com", "mydomain.com" is returned.)

GetIPAddress ( ) : String

Return the IP address of a web visitor.

GetInternetExplorerVersion ( ) : Double

Return the version of Internet Explorer being used or -1 if the request came from another browser.

GetOSType ( ) : String

Return the operating system type for the current user agent

GetOSType ( String userAgent ) : String

Return the operating system type and version for the current user agent

GetOSType ( String userAgent, System.Int64 &majorVersion, System.Int64 &minorVersion, System.Int64 &buildVersion, String &osName ) : String

Return the operating system type for the current user agent

GetRedirectCodeText ( Int32 redirectCode ) : String

Contains the following Indexes: 301,302,303,304,305,307

GetSafariVersion ( ) : Double

Return the version of Apple Safari being used or -1 if the request came from another browser.

GetUrlParams ( ) : String

Get the current URL parameters as a single string, without the leading "?".

GetUrlParams ( System.Boolean includePrefix ) : String

Get the current URL parameters as a single string, without the leading "?".

GetWebPage ( String url ) : String

Perform an Http GET operation, and return the result.

GetWebPage ( String url, CookieContainer cookies ) : String

Perform an Http GET operation, passing cookies, and return the result.

GetWebPage ( String url, GetWebPageMethod method, CookieContainer cookies, String postData, String userName, String password ) : String

Perform an Http GET or POST operation, passing cookies, post data, user name and password, and return the result.

GetWebPage ( String url, GetWebPageMethod method, CookieContainer cookies, String postData, String userName, String password, Int32 timeoutMilliseconds ) : String

Perform an Http GET or POST operation, passing cookies, post data, user name and password, and return the result.

GetWebPage ( String url, GetWebPageMethod method, String postData ) : String

Perform an Http GET or POST operation, and return the result.

GetWebPage ( String url, Int32 timeoutMilliseconds ) : String

Perform an Http GET operation, and return the result. Timeout in milliseconds is passed as well.

GetWebPage ( String url, String userName, String password ) : String

Perform an Http GET operation, passing credentials, and return the result.

Redirect ( Page pageToRedirect, String redirectLocation, Int32 code ) : void

Core redirect function. Redirects the provided page using the provided redirect code and location. Usage: H3Http.Redirect(this, "http://fynydd.com", 301);

Redirect303 ( Page pageToRedirect, String redirectLocation ) : void

Commonly used 303 redirect ("See Other"). Redirects the user, but the browser is instructed not to cache this response. Similar to 307, but more SEO friendly. Usage: H3Http.Redirect303(this, "http://fynydd.com");

Redirect307 ( Page pageToRedirect, String redirectLocation ) : void

Commonly used 307 redirect ("Temporary Redirect"). Redirects the user, but the browser is instructed that it *should* not cache this response (not guaranteed). Usage: H3Http.Redirect307(this, "http://fynydd.com");

SetUrlParameterValue ( String urlParam, String value ) : String

Add or Edit a URL parameter value in the current URL. If the parameter exists, it is modified. Otherwise, its value is changed.

SetUrlParameterValue ( String urlParam, String value, String urlParameterString ) : String

Add or Edit a URL parameter value. If the parameter exists on the supplied URL parameter string, it is modified. Otherwise, its value is changed.

WriteBinaryFile ( String url, String filePath ) : System.Int64

Read a binary file from a URL and write it to disk.

비공개 메소드들

메소드 설명
BuildMatch ( String pattern, String userAgent, String browser, Int32 versionIndex, String browserNameVersionFallback, String &browserName, System.Int64 &majorVersion, System.Int64 &minorVersion, System.Int64 &buildVersion ) : String
H3Http ( ) : System

메소드 상세

AddCrossBrowserClientRedirect() 공개 정적인 메소드

Add a cross browser compliant client side redirect (which ensures that the Referrer value will be not null on the subsequent page) with a zero second delay.
public static AddCrossBrowserClientRedirect ( Page pageToAddScriptTo, String url ) : void
pageToAddScriptTo System.Web.UI.Page The page to which the ClientScript will be Registered as a StartupScript.
url String String representation of a URL to which the page will redirect.
리턴 void

AddCrossBrowserClientRedirect() 공개 정적인 메소드

Add a cross browser compliant client side redirect (which ensures that the Referrer value will be not null on the subsequent page).
public static AddCrossBrowserClientRedirect ( Page pageToAddScriptTo, String url, Int32 seconds ) : void
pageToAddScriptTo System.Web.UI.Page The page to which the ClientScript will be Registered as a StartupScript.
url String String representation of a URL to which the page will redirect.
seconds System.Int32 Int32 value of seconds to delay before redirecting.
리턴 void

AddUrlParamPrefix() 공개 정적인 메소드

When passed a URL parameter list, it is returned with the leading "?", or as a blank string if there are no parameters. This method is used to ensure that a URL parameter list starts with a "?".
public static AddUrlParamPrefix ( String urlParams ) : String
urlParams String URL parameters list with or without the leading "?".
리턴 String

DeleteUrlParameter() 공개 정적인 메소드

Remove a URL parameter from the current URL parameter list and return the new request string.
public static DeleteUrlParameter ( String urlParam ) : String
urlParam String Name of the URL parameter to remove.
리턴 String

DeleteUrlParameter() 공개 정적인 메소드

Remove a URL parameter and return the new request string.
public static DeleteUrlParameter ( String urlParam, String urlParameterString ) : String
urlParam String Name of the URL parameter to remove.
urlParameterString String The URL parameter string to modify, without the leading "?".
리턴 String

DomainRedirect() 공개 정적인 메소드

Determine if the user needs to be redirected to a new URL, for sites that have multiple domain names, but one primary (e.g. like catching misspellings in domain names). The transport (e.g. http://) is not used or returned with the result of the method.
public static DomainRedirect ( String defaultPageName, String domainName ) : String
defaultPageName String default page file name used on the site (e.g. default.aspx).
domainName String Primary domain name that should be used (e.g. nonsequiturs.com).
리턴 String

GetBrowser() 공개 정적인 메소드

Return the browser name and version.
public static GetBrowser ( String userAgent ) : String
userAgent String Browser user agent string
리턴 String

GetBrowser() 공개 정적인 메소드

Return the browser name and version.
public static GetBrowser ( String userAgent, System.Int64 &majorVersion, System.Int64 &minorVersion, System.Int64 &buildVersion, String &browserName ) : String
userAgent String Browser user agent string
majorVersion System.Int64 Output of major version
minorVersion System.Int64 Output of minor version
buildVersion System.Int64 Output of build version
browserName String Output of browser name
리턴 String

GetBrowserMajorVersion() 공개 정적인 메소드

Return the browser major version number.
public static GetBrowserMajorVersion ( ) : String
리턴 String

GetBrowserMinorVersion() 공개 정적인 메소드

Return the browser minor version number.
public static GetBrowserMinorVersion ( ) : String
리턴 String

GetBrowserName() 공개 정적인 메소드

Return the browser name.
public static GetBrowserName ( ) : String
리턴 String

GetBrowserVersion() 공개 정적인 메소드

Return the version of specific browser based on HTTP headers or -1 if the request came from another browser.
public static GetBrowserVersion ( String browserName ) : Double
browserName String
리턴 Double

GetCurrentPageName() 공개 정적인 메소드

Retrieve the current page file name on disk.
public static GetCurrentPageName ( ) : String
리턴 String

GetFirefoxVersion() 공개 정적인 메소드

Return the version of Mozilla Firefox being used or -1 if the request came from another browser.
public static GetFirefoxVersion ( ) : Double
리턴 Double

GetHost() 공개 정적인 메소드

Get the fully qualified domain name of the current URL.
public static GetHost ( ) : String
리턴 String

GetHostRoot() 공개 정적인 메소드

Get the root domain from the fully qualified domain name of the current URL. (e.g. if visiting "www.mydomain.com", "mydomain.com" is returned.)
public static GetHostRoot ( ) : String
리턴 String

GetIPAddress() 공개 정적인 메소드

Return the IP address of a web visitor.
public static GetIPAddress ( ) : String
리턴 String

GetInternetExplorerVersion() 공개 정적인 메소드

Return the version of Internet Explorer being used or -1 if the request came from another browser.
public static GetInternetExplorerVersion ( ) : Double
리턴 Double

GetOSType() 공개 정적인 메소드

Return the operating system type for the current user agent
public static GetOSType ( ) : String
리턴 String

GetOSType() 공개 정적인 메소드

Return the operating system type and version for the current user agent
public static GetOSType ( String userAgent ) : String
userAgent String Web browser User Agent string
리턴 String

GetOSType() 공개 정적인 메소드

Return the operating system type for the current user agent
public static GetOSType ( String userAgent, System.Int64 &majorVersion, System.Int64 &minorVersion, System.Int64 &buildVersion, String &osName ) : String
userAgent String Web browser User Agent string
majorVersion System.Int64 Output of major version
minorVersion System.Int64 Output of minor version
buildVersion System.Int64 Output of build version
osName String Output of OS name
리턴 String

GetRedirectCodeText() 공개 정적인 메소드

Contains the following Indexes: 301,302,303,304,305,307
public static GetRedirectCodeText ( Int32 redirectCode ) : String
redirectCode System.Int32 Redirect Code number (e.g. 301)
리턴 String

GetSafariVersion() 공개 정적인 메소드

Return the version of Apple Safari being used or -1 if the request came from another browser.
public static GetSafariVersion ( ) : Double
리턴 Double

GetUrlParams() 공개 정적인 메소드

Get the current URL parameters as a single string, without the leading "?".
public static GetUrlParams ( ) : String
리턴 String

GetUrlParams() 공개 정적인 메소드

Get the current URL parameters as a single string, without the leading "?".
public static GetUrlParams ( System.Boolean includePrefix ) : String
includePrefix System.Boolean Include the leading "?" if there are parameters.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET operation, and return the result.
public static GetWebPage ( String url ) : String
url String Fully qualified URL to the remote page.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET operation, passing cookies, and return the result.
public static GetWebPage ( String url, CookieContainer cookies ) : String
url String Fully qualified URL to the remote page.
cookies System.Net.CookieContainer CookieContainer variable for sending cookies.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET or POST operation, passing cookies, post data, user name and password, and return the result.
public static GetWebPage ( String url, GetWebPageMethod method, CookieContainer cookies, String postData, String userName, String password ) : String
url String Fully qualified URL to the remote page.
method GetWebPageMethod GetWebPageMethod enum value.
cookies System.Net.CookieContainer CookieContainer variable for sending cookies.
postData String String post data for sending a post.
userName String User name string for Windows Authentication.
password String password string for Windows Authentication.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET or POST operation, passing cookies, post data, user name and password, and return the result.
public static GetWebPage ( String url, GetWebPageMethod method, CookieContainer cookies, String postData, String userName, String password, Int32 timeoutMilliseconds ) : String
url String Fully qualified URL to the remote page.
method GetWebPageMethod GetWebPageMethod enum value.
cookies System.Net.CookieContainer CookieContainer variable for sending cookies.
postData String String post data for sending a post.
userName String User name string for Windows Authentication.
password String password string for Windows Authentication.
timeoutMilliseconds System.Int32 Timeout in milliseconds for the request.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET or POST operation, and return the result.
public static GetWebPage ( String url, GetWebPageMethod method, String postData ) : String
url String Fully qualified URL to the remote page.
method GetWebPageMethod GetWebPageMethod enum value.
postData String String post data for sending a post.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET operation, and return the result. Timeout in milliseconds is passed as well.
public static GetWebPage ( String url, Int32 timeoutMilliseconds ) : String
url String Fully qualified URL to the remote page.
timeoutMilliseconds System.Int32 Timeout in milliseconds for the request.
리턴 String

GetWebPage() 공개 정적인 메소드

Perform an Http GET operation, passing credentials, and return the result.
public static GetWebPage ( String url, String userName, String password ) : String
url String Fully qualified URL to the remote page.
userName String User name string for Windows Authentication.
password String password string for Windows Authentication.
리턴 String

Redirect() 공개 정적인 메소드

Core redirect function. Redirects the provided page using the provided redirect code and location. Usage: H3Http.Redirect(this, "http://fynydd.com", 301);
public static Redirect ( Page pageToRedirect, String redirectLocation, Int32 code ) : void
pageToRedirect System.Web.UI.Page The Page object which is to be redirected
redirectLocation String The url to which the page will be redirected
code System.Int32 The 3 digit (301,302,303,304,305, or 307) redirect code to use.
리턴 void

Redirect303() 공개 정적인 메소드

Commonly used 303 redirect ("See Other"). Redirects the user, but the browser is instructed not to cache this response. Similar to 307, but more SEO friendly. Usage: H3Http.Redirect303(this, "http://fynydd.com");
public static Redirect303 ( Page pageToRedirect, String redirectLocation ) : void
pageToRedirect System.Web.UI.Page The Page object which is to be redirected
redirectLocation String The url to which the page will be redirected
리턴 void

Redirect307() 공개 정적인 메소드

Commonly used 307 redirect ("Temporary Redirect"). Redirects the user, but the browser is instructed that it *should* not cache this response (not guaranteed). Usage: H3Http.Redirect307(this, "http://fynydd.com");
public static Redirect307 ( Page pageToRedirect, String redirectLocation ) : void
pageToRedirect System.Web.UI.Page The Page object which is to be redirected
redirectLocation String The url to which the page will be redirected
리턴 void

SetUrlParameterValue() 공개 정적인 메소드

Add or Edit a URL parameter value in the current URL. If the parameter exists, it is modified. Otherwise, its value is changed.
public static SetUrlParameterValue ( String urlParam, String value ) : String
urlParam String Name of the URL parameter.
value String Value of the URL parameter to add or edit.
리턴 String

SetUrlParameterValue() 공개 정적인 메소드

Add or Edit a URL parameter value. If the parameter exists on the supplied URL parameter string, it is modified. Otherwise, its value is changed.
public static SetUrlParameterValue ( String urlParam, String value, String urlParameterString ) : String
urlParam String Name of the URL parameter.
value String Value of the URL parameter to add or edit.
urlParameterString String The URL parameter string to modify, without the leading "?".
리턴 String

WriteBinaryFile() 공개 정적인 메소드

Read a binary file from a URL and write it to disk.
public static WriteBinaryFile ( String url, String filePath ) : System.Int64
url String URL to the web resource.
filePath String Web-style path for the destination file on disk, including new file name.
리턴 System.Int64