打印本文 打印本文 关闭窗口 关闭窗口
AfxParseURL的源码
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4735  更新时间:2009/4/25 0:44:54  文章录入:mintao  责任编辑:mintao
>       urlComponents.lpszUrlPath = strObject.GetBuffer(INTERNET_MAX_PATH_LENGTH+1);

       urlComponents.dwUserNameLength = INTERNET_MAX_USER_NAME_LENGTH;

       urlComponents.lpszUserName = strUsername.GetBuffer(INTERNET_MAX_USER_NAME_LENGTH+1);

       urlComponents.dwPasswordLength = INTERNET_MAX_PASSWORD_LENGTH;

       urlComponents.lpszPassword = strPassword.GetBuffer(INTERNET_MAX_PASSWORD_LENGTH+1);

 

       BOOL bRetVal = _AfxParseURLWorker(pstrURL, &urlComponents,

                                   dwServiceType, nPort, dwFlags);

 

       strServer.ReleaseBuffer();

       strObject.ReleaseBuffer();

       strUsername.ReleaseBuffer();

       strPassword.ReleaseBuffer();

       return bRetVal;

}

 

BOOL AFXAPI AfxParseURL(LPCTSTR pstrURL, DWORD& dwServiceType,

       CString& strServer, CString& strObject, INTERNET_PORT& nPort)

{

       dwServiceType = AFX_INET_SERVICE_UNK;

 

       ASSERT(pstrURL != NULL);

       if (pstrURL == NULL)

              return FALSE;

 

       URL_COMPONENTS urlComponents;

       memset(&urlComponents, 0, sizeof(URL_COMPONENTS));

       urlComponents.dwStructSize = sizeof(URL_COMPONENTS);

 

       urlComponents.dwHostNameLength = INTERNET_MAX_URL_LENGTH;

       urlComponents.lpszHostName = strServer.GetBuffer(INTERNET_MAX_URL_LENGTH+1);

       urlComponents.dwUrlPathLength = INTERNET_MAX_URL_LENGTH;

       urlComponents.lpszUrlPath = strObject.GetBuffer(INTERNET_MAX_URL_LENGTH+1);

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

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