HttpServerUtility.TransferRequest HttpServerUtility.TransferRequest HttpServerUtility.TransferRequest HttpServerUtility.TransferRequest Method

定義

執行所指定 URL 的非同步執行工作。Performs an asynchronous execution of the specified URL.

多載

TransferRequest(String) TransferRequest(String) TransferRequest(String) TransferRequest(String)

執行所指定 URL 的非同步執行工作。Performs an asynchronous execution of the specified URL.

TransferRequest(String, Boolean) TransferRequest(String, Boolean) TransferRequest(String, Boolean) TransferRequest(String, Boolean)

執行所指定 URL 的非同步執行工作,並保留查詢字串參數。Performs an asynchronous execution of the specified URL and preserves query string parameters.

TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection)

使用指定的 HTTP 方法與標頭執行所指定 URL 的非同步執行工作。Performs an asynchronous execution of the specified URL using the specified HTTP method and headers.

TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean)

使用指定的 HTTP 方法、標頭和路徑,並選擇性地保留表單值和使用者識別,執行所指定 URL 的非同步執行。Performs an asynchronous execution of the specified URL using the specified HTTP method, headers, and path, and optionally preserves form values and the user identity.

備註

TransferRequest .NET Framework 3.5 版中引進。TransferRequest was introduced in the .NET Framework version 3.5. 摘要的.NET Framework 的詳細資訊,請參閱版本和相依性For summary information about the .NET Framework, see Versions and Dependencies.

TransferRequest(String) TransferRequest(String) TransferRequest(String) TransferRequest(String)

執行所指定 URL 的非同步執行工作。Performs an asynchronous execution of the specified URL.

public:
 void TransferRequest(System::String ^ path);
public void TransferRequest (string path);
member this.TransferRequest : string -> unit
Public Sub TransferRequest (path As String)

參數

path
String String String String

要在伺服器上執行之新網頁的 URL 路徑。The URL path of the new page on the server to execute.

例外狀況

此要求需要 IIS 7.0IIS 7.0 的 Integrated 管線模式。The request requires the integrated pipeline mode of IIS 7.0IIS 7.0.

無法使用伺服器來處理要求。The server is not available to handle the request.

path 參數無效。The path parameter is invalid.

備註

這個方法多載會呼叫TransferRequest多載preserveForm參數設為false,則method參數設定為null,則headers參數設定為null,和preserveUser參數設定為trueThis method overload calls the TransferRequest overload with the preserveForm parameter set to false, the method parameter set to null, the headers parameter set to null, and the preserveUser parameter set to true. 如需詳細資訊,請參閱 < 備註 > 一節TransferRequest(String, Boolean, String, NameValueCollection)多載。For more information, see the "Remarks" section in TransferRequest(String, Boolean, String, NameValueCollection) overload.

TransferRequest(String, Boolean) TransferRequest(String, Boolean) TransferRequest(String, Boolean) TransferRequest(String, Boolean)

執行所指定 URL 的非同步執行工作,並保留查詢字串參數。Performs an asynchronous execution of the specified URL and preserves query string parameters.

public:
 void TransferRequest(System::String ^ path, bool preserveForm);
public void TransferRequest (string path, bool preserveForm);
member this.TransferRequest : string * bool -> unit
Public Sub TransferRequest (path As String, preserveForm As Boolean)

參數

path
String String String String

要在伺服器上執行之新網頁的 URL 路徑。The URL path of the new page on the server to execute.

preserveForm
Boolean Boolean Boolean Boolean

true 表示保留 Form 集合,false 表示清除 Form 集合。true to preserve the Form collection; false to clear the Form collection.

例外狀況

此要求需要 IIS 7.0IIS 7.0 的 Integrated 管線模式。The request requires the integrated pipeline mode of IIS 7.0IIS 7.0.

無法使用伺服器來處理要求。The server is not available to handle the request.

path 參數無效。The path parameter is invalid.

備註

這個多載會呼叫TransferRequest多載preserveForm參數設定中,傳遞的值為method參數設定為null,則headers參數設為null,和preserveUser參數集若要trueThis overload calls the TransferRequest overload with the preserveForm parameter set to the value passed in, the method parameter set to null, the headers parameter set to null, and the preserveUser parameter set to true. 如需詳細資訊,請參閱 < 備註 > 一節TransferRequest(String, Boolean, String, NameValueCollection)For more information, see the "Remarks" section in TransferRequest(String, Boolean, String, NameValueCollection).

TransferRequest .NET Framework 3.5 版中引進。TransferRequest is introduced in the .NET Framework version 3.5. 如需詳細資訊,請參閱版本和相依性For more information, see Versions and Dependencies.

TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection) TransferRequest(String, Boolean, String, NameValueCollection)

使用指定的 HTTP 方法與標頭執行所指定 URL 的非同步執行工作。Performs an asynchronous execution of the specified URL using the specified HTTP method and headers.

public:
 void TransferRequest(System::String ^ path, bool preserveForm, System::String ^ method, System::Collections::Specialized::NameValueCollection ^ headers);
public void TransferRequest (string path, bool preserveForm, string method, System.Collections.Specialized.NameValueCollection headers);
member this.TransferRequest : string * bool * string * System.Collections.Specialized.NameValueCollection -> unit
Public Sub TransferRequest (path As String, preserveForm As Boolean, method As String, headers As NameValueCollection)

參數

path
String String String String

要在伺服器上執行之新網頁的 URL 路徑。The URL path of the new page on the server to execute.

preserveForm
Boolean Boolean Boolean Boolean

true 表示保留 Form 集合,false 表示清除 Form 集合。true to preserve the Form collection; false to clear the Form collection.

method
String String String String

用於執行新要求的 HTTP 方法。The HTTP method to use in the execution of the new request.

headers
NameValueCollection NameValueCollection NameValueCollection NameValueCollection

新要求之要求標頭的 NameValueCollectionA NameValueCollection of request headers for the new request.

例外狀況

此要求需要 IIS 7.0IIS 7.0 以 Integrated 模式執行。The request requires IIS 7.0IIS 7.0 running in integrated mode.

無法使用伺服器來處理要求。The server is not available to handle the request.

path 參數無效。The path parameter is invalid.

備註

使用整合式的管線模式執行時,會使用這個方法IIS 7.0IIS 7.0以允許要求處理程序從一個資源類型之間傳輸時執行正確的要求內容的目標要求。This method is used when running with the integrated pipeline mode in IIS 7.0IIS 7.0 to allow request processing to be transferred from one resource type to another while executing the target request with the correct request context. 例如,您可以使用TransferRequestASPX 頁面要求傳送至 XML 頁面要求的方法。For example, you can use the TransferRequest method to transfer a request for an ASPX page to a request for an XML page.

TransferRequest方法執行非同步的子系執行指定的 URL 具有下列條件:The TransferRequest method performs an asynchronous child execution of the specified URL with the following conditions:

  • 如果path參數會指定查詢字串,它會當做新的查詢字串。If the path parameter specifies a query string, it will be used as the new query string. 如果沒有查詢字串包含,則會重複使用要求的查詢字串。If no query string is included, the query string of the request will be re-used.

  • 如果method參數指定,則會使用它。If the method parameter is specified, it will be used. 如果是null,將會使用原始要求的 HTTP 方法。If it is null, the HTTP method of the original request will be used.

  • 如果preserveForm參數是true,目前實體的要求可供目標要求。If the preserveForm parameter is true, the current entity body of the request will be available to the target request. 這可讓表單張貼,並上傳至傳輸。This allows form posts and uploads to be transferred.

  • 如果原始要求上目前設定的使用者身分識別,身分識別會傳輸至新的要求。If the user identity is currently set on the original request, the identity will be transferred to the new request. 這可讓已驗證的要求,重複使用的新要求的驗證結果。This allows authenticated requests to re-use the result of the authentication for the new request. 如果您不想要傳送的使用者,將使用者設定為null在移轉之前在原始要求。If you do not want the user to be transferred, set the user to null on the original request before transferring.

  • 如果headers指定參數,新的要求會執行指定的標頭。If the headers parameter is specified, the new request will execute with the specified headers. 這可用來修改要求標頭和新的要求,cookie,或新增特殊標頭,指定已在接收到原始的要求。This can be used to modify the request headers and cookies for the new request, or add a special header that specifies where the original request was received.

    這個方法會呼叫TransferRequest(String, Boolean, String, NameValueCollection, Boolean)方法多載preserveUser參數設為trueThis method calls the TransferRequest(String, Boolean, String, NameValueCollection, Boolean) method overload with the preserveUser parameter set to true.

TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean) TransferRequest(String, Boolean, String, NameValueCollection, Boolean)

使用指定的 HTTP 方法、標頭和路徑,並選擇性地保留表單值和使用者識別,執行所指定 URL 的非同步執行。Performs an asynchronous execution of the specified URL using the specified HTTP method, headers, and path, and optionally preserves form values and the user identity.

public:
 void TransferRequest(System::String ^ path, bool preserveForm, System::String ^ method, System::Collections::Specialized::NameValueCollection ^ headers, bool preserveUser);
public void TransferRequest (string path, bool preserveForm, string method, System.Collections.Specialized.NameValueCollection headers, bool preserveUser);
member this.TransferRequest : string * bool * string * System.Collections.Specialized.NameValueCollection * bool -> unit
Public Sub TransferRequest (path As String, preserveForm As Boolean, method As String, headers As NameValueCollection, preserveUser As Boolean)

參數

path
String String String String

路徑。The path.

preserveForm
Boolean Boolean Boolean Boolean

true 表示保留 Form 集合,false 表示清除 Form 集合。true to preserve the Form collection; false to clear the Form collection.

method
String String String String

用於新要求的 HTTP 方法。The HTTP method to use in the new request.

headers
NameValueCollection NameValueCollection NameValueCollection NameValueCollection

包含新要求之要求標頭的 NameValueCollection 物件。A NameValueCollection object that contains request headers for the new request.

preserveUser
Boolean Boolean Boolean Boolean

true 表示要保留使用者識別,否則為 falsetrue to preserve the user identity; otherwise, false. 這個方法的其他方法多載會呼叫這個多載(在此參數設定為true的情況下)。The other method overloads of this method call this overload with this parameter set to true.

例外狀況

此要求需要 IIS 7.0IIS 7.0 的 Integrated 管線模式。The request requires the integrated pipeline mode of IIS 7.0IIS 7.0.

無法使用伺服器來處理要求。The server is not available to handle the request.

path 參數無效。The path parameter is invalid.

備註

如需詳細資訊,請參閱 < 備註 > 一節TransferRequest(String, Boolean, String, NameValueCollection)For more information, see the "Remarks" section in TransferRequest(String, Boolean, String, NameValueCollection).

適用於