7,763
社区成员
发帖
与我相关
我的任务
分享
Stri = "http://www.soso.com/search?new=2&q=字符串在此&viewIndex=7&source=searchnew"
MsgBox Mid(Stri, InStr(Stri, "q=") + 2, InStr(InStr(Stri, "q="), Stri, "&") - InStr(Stri, "q=") - 2)
#include "stdafx.h"
#include "windows.h"
#include <stdio.h>
VOID GetString(LPSTR lpURL,LPSTR lpOutString)
{
LPSTR Start,End;
Start = lpURL;
while (*Start){
if (*Start=='q'){
if (*(Start+1)=='='){
Start+=2;
break;
}
else{
Start+=2;
}
}
else{
Start++;
}
}
End = Start;
while (*End){
if (*End=='&'){
break;
}
End++;
}
memcpy(lpOutString,Start,End-Start);
}
VOID main()
{
CHAR strURL[256]="http://www.soso.com/search?new=2&q=字符串在此&viewIndex=7&source=searchnew";
CHAR strOutString[256]={0};
DWORD dwTime=GetTickCount();
for (int i=0;i<100000;i++){
GetString(strURL,strOutString);
}
}