【发布时间】:2014-09-25 10:38:33
【问题描述】:
当我尝试在 URL_COMPONENTS 结构中破解我的 URL 时,我的这个函数有点问题,HostName 和 urlPath 成员的值保持在 '\0' 同时它是这样的,我有真正的长度两者(HostName 和 urlPath 成员)。 有什么问题?,如果您通过代码回答,我会很高兴。
感谢和最良好的祝愿, 约翰·史密斯。
URL_COMPONENTS urlcomponents;
urlcomponents.dwStructSize=sizeof(URL_COMPONENTS);
urlcomponents.dwHostNameLength=10;
urlcomponents.dwPasswordLength=10;
urlcomponents.dwSchemeLength=10;
urlcomponents.dwUrlPathLength=10;
urlcomponents.dwUserNameLength=10;
urlcomponents.dwExtraInfoLength=10;
urlcomponents.lpszExtraInfo=extraInfo;
urlcomponents.lpszHostName=hostName;
urlcomponents.lpszPassword=passwordSet;
urlcomponents.lpszScheme=schemeUrl;
urlcomponents.lpszUrlPath=fileUrlPath;
urlcomponents.lpszUserName=userName;
//urlcomponents.nPort=80;
std::string originUrl="http://s1.asandownload.com/mobile/android/application/Color.Effect.Booth.Pro.v1.4.2_AsanDl.com.apk";
InternetCrackUrl(originUrl.c_str(),originUrl.Length(),0,&urlcomponents);
【问题讨论】:
标签: c++ parsing winapi url wininet