- PrivateDeclareFunctionMultiByteToWideCharLib"kernel32"(ByValCodePageAsLong,ByValdwFlagsAsLong,ByVallpMultiByteStrAsLong,ByValcchMultiByteAsLong,ByVallpWideCharStrAsLong,ByValcchWideCharAsLong)AsLong
- PrivateConstCP_UTF8=65001
- FunctionUtf8ToUnicode(ByRefUtf()AsByte)AsString
- DimlRetAsLong
- DimlLengthAsLong
- DimlBufferSizeAsLong
- lLength=UBound(Utf)-LBound(Utf)+1
- IflLength<=0ThenExitFunction
- lBufferSize=lLength*2
- Utf8ToUnicode=String$(lBufferSize,Chr(0))
- lRet=MultiByteToWideChar(CP_UTF8,VarPtr(Utf(0)),lLength,StrPtr(Utf8ToUnicode),lBufferSize)
- IflRet<>0Then
- Utf8ToUnicode=Left(Utf8ToUnicode,lRet)
- EndIf
- EndFunction
- FunctionSourcecodeofXunleizixun(ByValmenuindexAsLong)AsString
- Dimb()AsByte,indexurl(5)AsString
- IfNotmenuindexLike"[0-5]"ThenExitFunction
- indexurl(0)="http://recommend.xunlei.com/desknews_v2_game.html"'0---游戏
- indexurl(1)="http://recommend.xunlei.com/desknews_v2_ent.html"'1---娱乐
- indexurl(2)="http://biz5c.sandai.net/desktopnews/iframe/hot_14.htm"'2---婚恋
- indexurl(3)="http://www.eachnet.com/landing/xunlei08_3.html"'3---网购
- indexurl(4)="http://biz5c.sandai.net/desktopnews/iframe/hot_2.htm"'4---财经
- indexurl(5)="http://biz5c.sandai.net/desktopnews/iframe/hot_3.htm"'5---IT
- WithCreateObject("Msxml2.XMLHTTP")
- .Open"GET",indexurl(menuindex),False
- .Send
- b=.ResponseBody
- EndWith
- SourcecodeofXunleizixun=Utf8ToUnicode(b)
- EndFunction
- SubGetxunlei()
- Debug.PrintSourcecodeofXunleizixun(1)'娱乐资讯
- EndSub