HttpListenerResponse.Redirect メソッド
アセンブリ: System (system.dll 内)


Redirect メソッドは、クライアントをリソースの新しい場所にリダイレクトするために使用されます。このメソッドは、応答の Location ヘッダーを url に設定し、StatusCode プロパティを Redirect に設定し、StatusDescription プロパティを "Found" に設定します。

メソッドの呼び出しについては、次のコード例を参照してください。
public static void PermanentRedirect(HttpListenerRequest request, HttpListenerResponse response) { if (request.Url.OriginalString == @"http://www.contoso.com/index.html") { // Sets the location header, status code and status description. response.Redirect(@"http://www.contoso.com/indexServer/index.html"); } }

Windows 98, Windows Server 2003, Windows XP Media Center Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- HttpListenerResponse.Redirect メソッドのページへのリンク