打印本文 打印本文 关闭窗口 关闭窗口
AfxParseURL的源码
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3675  更新时间:2009/4/25 0:44:54  文章录入:mintao  责任编辑:mintao

/////////////////////////////////////////////////////////////////////////////

// Global Functions

 

AFX_STATIC BOOL AFXAPI _AfxParseURLWorker(LPCTSTR pstrURL,

       LPURL_COMPONENTS lpComponents, DWORD& dwServiceType,

       INTERNET_PORT& nPort, DWORD dwFlags)

{

       // this function will return bogus stuff if lpComponents

       // isn''''t set up to copy the components

 

       ASSERT(lpComponents != NULL && pstrURL != NULL);

       if (lpComponents == NULL || pstrURL == NULL)

              return FALSE;

       ASSERT(lpComponents->dwHostNameLength == 0 ||

                     lpComponents->lpszHostName != NULL);

       ASSERT(lpComponents->dwUrlPathLength == 0 ||

                     lpComponents->lpszUrlPath != NULL);

       ASSERT(lpComponents->dwUserNameLength == 0 ||

                     lpComponents->lpszUserName != NULL);

       ASSERT(lpComponents->dwPasswordLength == 0 ||

                     lpComponents->lpszPassword != NULL);

 

       ASSERT(AfxIsValidAddress(lpComponents, sizeof(URL_COMPONENTS), TRUE));

 

       LPTSTR pstrCanonicalizedURL;

       TCHAR szCanonicalizedURL[INTERNET_MAX_URL_LENGTH];

       DWORD dwNeededLength = INTERNET_MAX_URL_LENGTH;

       BOOL bRetVal;

       BOOL bMustFree = FALSE;

       DWORD dwCanonicalizeFlags = dwFlags &

              (ICU_NO_ENCODE | ICU_DECODE | ICU_NO_META |

[1] [2] [3] [4] [5] [6]  下一页

打印本文 打印本文 关闭窗口 关闭窗口