IIS过滤器,怎么能捕获到请求的URL并修改后转向??我写的ISAPI的网站,URL地址为:
“http://www.xxxxxx.com/disapi.dll/blist?aa=123&bb=456”
我想做个IIS过滤器,获得这个地址串,进行一些访问权限的操作,
我从网上找到一些资料,用GetFilterVersion和HttpFilterProc写了
一个过滤器,可是取不到全部地址串,只能取到“www.xxxxxx.com”
如何才能取到全部地址串,并在处理后再分别转向到不同的网址??

解决方案 »

  1.   

    这个MSDN上的例子,应该是这一段,那位C好的能帮我改成DELPHI吗
    The following code demonstrates how to use an OnUrlMap notification in the filter to redirect a request to a different URL. If the URL contains a DoRedirect string (for example, http://server/doRedirect), the request will be redirected to http://www.microsoft.com.DWORD CFiltRedirFilter::OnUrlMap(CHttpFilterContext* pCtxt,
       PHTTP_FILTER_URL_MAP pMapInfo)
    {
       CHAR szRedirect [256];   if (strstr (pMapInfo->pszURL, "DoRedirect"))
       {
          CHAR szRedirect [256];
          // replace www.microsoft.com with desired server
          sprintf(szRedirect, "Location: http://%s\r\n\r\n", "www.microsoft.com");
          pCtxt->ServerSupportFunction ( SF_REQ_SEND_RESPONSE_HEADER, 
                (LPVOID) "302 Redirect", 
                (DWORD *) szRedirect, 
                0 );
          // Print a message to the debug window
          ISAPITRACE1 ("Redirecting to: %s\n", szRedirect);
          // we are done with this request
          return SF_STATUS_REQ_FINISHED_KEEP_CONN;
       }
       // URL did not contain a DoRedirect string.
       return SF_STATUS_REQ_NEXT_NOTIFICATION;
    }
      

  2.   

    URL串不可能取不到,
    在CSDN翻出个例子,也许有用
    http://topic.csdn.net/t/20051210/21/4451294.html
      

  3.   

    可以使用GetServerVariable取名称为"HTTP_URL"变量.关于ServerVariable的说明,在MSDN这儿有
    http://msdn.microsoft.com/library/en-us/iissdk/html/21b3be8f-d4ed-4059-8e21-6cba2c253006.asp