HttpRequest.IsSecureConnection Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan nilai yang menunjukkan apakah koneksi HTTP menggunakan soket aman (yaitu HTTPS).
public:
property bool IsSecureConnection { bool get(); };
public bool IsSecureConnection { get; }
member this.IsSecureConnection : bool
Public ReadOnly Property IsSecureConnection As Boolean
Nilai Properti
true
jika koneksi adalah koneksi SSL; jika tidak, false
.
Contoh
Contoh kode berikut menentukan apakah IsSecureConnection properti diatur ke false. Jika ya, SuppressContent properti diatur ke true untuk menghentikan respons dikirim.
// Check whether the request is sent
// over HTTPS. If not, do not send
// content to the client.
if (!Request.IsSecureConnection)
{
Response.SuppressContent = true;
}
' Check whether the request is sent
' over HTTPS. If not, do not return
' content to the client.
If (Request.IsSecureConnection = False) Then
Response.SuppressContent = True
End If
Berlaku untuk
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk