Bagikan melalui


HttpResponse.Clear Metode

Definisi

Menghapus semua output konten dari aliran buffer.

public:
 void Clear();
public void Clear();
member this.Clear : unit -> unit
Public Sub Clear ()

Contoh

Contoh berikut mengatur ContentType properti untuk respons terhadap gambar/jpeg, memanggil Clear metode untuk menghapus konten lain yang mungkin dilampirkan ke respons, lalu mengatur properti ke true sehingga halaman lengkap akan diproses BufferOutput sebelum konten dikirim ke klien yang meminta.

Untuk contoh lengkapnya, lihat HttpResponse kelas .

    // Set the page's content type to JPEG files
    // and clears all content output from the buffer stream.
    Response.ContentType = "image/jpeg";
    Response.Clear();

    // Buffer response so that page is sent
    // after processing is complete.
    Response.BufferOutput = true;
' Set the page's content type to JPEG files
' and clears all content output from the buffer stream.
Response.ContentType = "image/jpeg"
Response.Clear()

' Buffer response so that page is sent
' after processing is complete.
Response.BufferOutput = True

Keterangan

Metode Clear ini tidak menghapus informasi header.

Berlaku untuk

Lihat juga