다음을 통해 공유


My.Response 개체

HttpResponse 연결된 개체를 Page가져옵니다. 이 개체를 사용하면 클라이언트에 HTTP 응답 데이터를 보낼 수 있으며 해당 응답에 대한 정보가 포함됩니다.

비고

개체는 My.Response 페이지와 연결된 현재 HttpResponse 개체를 포함합니다.

개체는 My.Response ASP.NET 애플리케이션에만 사용할 수 있습니다.

예시

다음 예제에서는 개체에서 My.Request 헤더 컬렉션을 가져오고 개체를 My.Response 사용하여 ASP.NET 페이지에 씁니다.

<script runat="server">
    Public Sub ShowHeaders()
        ' Load the header collection from the Request object.
        Dim coll As System.Collections.Specialized.NameValueCollection
        coll = My.Request.Headers

        ' Put the names of all keys into a string array.
        For Each key As String In coll.AllKeys
            My.Response.Write("Key: " & key & "<br>")

            ' Get all values under this key.
            For Each value As String In coll.GetValues(key)
                My.Response.Write("Value: " & _
                    Server.HtmlEncode(value) & "<br>")
            Next
        Next
    End Sub
</script>

참고하십시오