Y
yuanzhucn
Unregistered / Unconfirmed
GUEST, unregistred user!
(在浏览器地址中输入“http://expert.csdn.net/Expert/TopicView1.asp?id=1774414”最后显示”http://expert.csdn.net/Expert/topic/1774/1774414.xml?temp=.2644464”)<br><br>在flashget中我输入网址“http://expert.csdn.net/Expert/TopicView1.asp?id=1774414”下载得到文件“1774414.xml”,它是怎么实现的。<br>我有一个程序:<br>function GetInetFile (const fileURL, FileName: String): boolean;<br>const BufferSize = 1024; <br>var <br> hSession, hURL: HInternet; <br> Buffer: array[1..BufferSize] of Byte; <br> BufferLen: DWORD; f: File; <br> sAppName: string; <br>begin <br> Result:=False; <br> sAppName := ExtractFileName(Application.ExeName); <br> hSession := InternetOpen(PChar(sAppName),INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); <br> try <br> hURL := InternetOpenURL(hSession, PChar(fileURL), nil,0,0,0); <br> try <br> AssignFile(f, FileName); Rewrite(f,1); <br> repeat <br> InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen);<br> BlockWrite(f, Buffer, BufferLen) <br> until BufferLen = 0; <br> CloseFile(f); <br> Result:=True;<br><br> finally <br> InternetCloseHandle(hURL) <br> end <br> finally <br> InternetCloseHandle(hSession) <br> end <br>end; <br>但是当我把fileURL设为“http://expert.csdn.net/Expert/TopicView1.asp?id=1774414”时得不到我想要的1774414.xml文件,只有设为“http://expert.csdn.net/Expert/topic/1774/1774414.xml?temp=.2644464”才行。<br>