HttpListenerRequest.RawUrl 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取客户端请求的 URL 信息(不包括主机和端口)。
public:
 property System::String ^ RawUrl { System::String ^ get(); };public string? RawUrl { get; }public string RawUrl { get; }member this.RawUrl : stringPublic ReadOnly Property RawUrl As String属性值
String 包含此请求的原始 URL。
示例
下面的代码示例演示如何使用 RawUrl 属性。
public static void CheckTestUrl(HttpListener listener, HttpListenerRequest request)
{
    if (request.RawUrl == "/www.contoso.com/test/NoReply")
    {
        listener.Abort ();
        return;
    }
}
Public Shared Sub CheckTestUrl(ByVal listener As HttpListener, ByVal request As HttpListenerRequest)
    If request.RawUrl = "/www.contoso.com/test/NoReply" Then
        listener.Abort()
        Return
    End If
End Sub
注解
原始 URL 定义为 URL 中域信息后面的部分。 在 URL 字符串 http://www.contoso.com/articles/recent.aspx中,原始 URL 为 /articles/recent.aspx。 原始 URL 包含查询字符串(如果存在)。
若要获取主机和端口信息,请使用 RemoteEndPoint 属性。