My.Request, objet

Mise à jour : novembre 2007

Obtient l'objet HttpRequest pour la page demandée.

Notes

L'objet My.Request contient des informations sur la demande HTTP actuelle.

L'objet My.Request est uniquement disponible pour les applications ASP.NET.

Exemple

L'exemple suivant obtient la collection d'en-têtes de l'objet My.Request et utilise l'objet My.Response pour l'écrire dans la page ASP.NET.

<script >
    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>

Voir aussi

Référence

My.Response, objet

HttpRequest