获取网页验证码问题
老师好 看看下面的程序哪里出了问题 为什么下载不到验证码{
CInternetSession session;
CStringstrUrl;
CFile*pFile,out;
charbuff;
CStringstrPath;
// 产生八位随机数数组成验证码
int nRand1 = rand()%100000+10000;
int nRand2 = rand()%200000+10000;
strUrl.Format("http://www.mykh.net/misc.php?mod=seccode&update=46130&idhash=cSAdJ6MHh",nRand1,nRand2);
strPath = GetExePath()+ "\\123" ;
pFile = session.OpenURL(strUrl);
out.Open(strPath, CFile::modeCreate | CFile::modeWrite);
while(pFile->Read(buff,512)){
out.Write(buff,512);
}
out.Flush();
out.Close();
}
还有这段代码什么意思
int nRand1 = rand()%100000+10000;
int nRand2 = rand()%200000+10000;
有好心的 求完整的实例
顶顶更健康 请把完整的代码按照代码格式显示:
http://bbs.fishc.com/forum.php?mod=viewthread&tid=1742&page=1#pid11009
给你一个表达式:
a + rand() % (b-a+1) 就表示 a~b之间的一个随机数
页:
[1]