写ISAPI过滤器时被CSTRING的小问题卡住了
DWORD CIsapi1Filter::OnUrlMap(CHttpFilterContext* pCtxt,
PHTTP_FILTER_URL_MAP pMapInfo)
{
if (strstr (pMapInfo->pszURL, "www.icfamily.com"))
{
CHAR szRedirect [256];
CString cs_temp;
cs_temp.Format(_T("%s"),pMapInfo->pszURL);
cs_temp.Replace("www.icfamily.com","index.shtml");
cs_temp.Replace("http://","");
sprintf(szRedirect, "Location: http://%s\r\n\r\n",cs_temp);
pCtxt->ServerSupportFunction ( SF_REQ_SEND_RESPONSE_HEADER,
(LPVOID) "302 Redirect",
(DWORD *) szRedirect,
0 );
VC6用的少一些对一些基本概念不是非常了解,看了一下MSDN对于cstring的解释,并参考了一个网站的一篇文章写的,但是是有问题,谢谢各位,解决一下我的困惑,cstring在这里是不是应该这么用?
http://www.blog.com.cn/user15/mayaya/archives/2005/123622.shtml