HttpListenerResponse.RedirectLocation Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Bu yanıttaki HTTP Location
üst bilgisinin değerini alır veya ayarlar.
public:
property System::String ^ RedirectLocation { System::String ^ get(); void set(System::String ^ value); };
public string? RedirectLocation { get; set; }
public string RedirectLocation { get; set; }
member this.RedirectLocation : string with get, set
Public Property RedirectLocation As String
Özellik Değeri
String Üst bilgideki istemciye gönderilecek mutlak URL'yi Location
içeren.
Özel durumlar
Küme işlemi için belirtilen değer boş bir dizedir ("").
Bu nesne kapatıldı.
Örnekler
Aşağıdaki kod örneğinde bu özelliğin ayarlanması gösterilmektedir.
public static void TemporaryRedirect(HttpListenerRequest request, HttpListenerResponse response)
{
if (request.Url.OriginalString == @"http://www.contoso.com/index.html")
{
response.RedirectLocation = @"http://www.contoso.com/indexServer/index.html";
}
}
Public Shared Sub TemporaryRedirect(ByVal request As HttpListenerRequest, ByVal response As HttpListenerResponse)
If request.Url.OriginalString = "http://www.contoso.com/index.html" Then
response.RedirectLocation = "http://www.contoso.com/indexServer/index.html"
End If
End Sub
Açıklamalar
Üst bilgi, Location
istemcinin istenen kaynağı bulmak için yönlendirildiği URL'yi belirtir.
Not
Bu özelliğin ayarlanması özelliği otomatik olarak ayarlamaz StatusCode .
Şunlara uygulanır
Ayrıca bkz.
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin