日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

html如何获得网址,已知一个网址,如何获得该网址对应的html源代码?在del 找人事管理软件...

發布時間:2025/3/20 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html如何获得网址,已知一个网址,如何获得该网址对应的html源代码?在del 找人事管理软件... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

銷售管理軟件版1樓: 已知一個網址,如何獲得該網址對應的html源代碼?在delphi中如何實現?今天不解決,沒飯吃了。。。

2樓: 用WebBrowser控件,先把網址傳給WebBrowser,然后在想辦法。因為瀏覽網頁時,在本地緩存中都保留文件,在Temporary Internet Files目錄中找到該文件即可。

或者直接在WebBrowser上想辦法,因為WebBrowser本來就是為瀏覽html而做的 如人事管理軟件

3樓: //html->

function TShowEmailInfoFrm.ShowEmailInfo(EmailStr: WideString): Boolean;

var

htmldocument : ihtmldocument2;

begin

Result:=False;

try

htmldocument := EmailBrower.Document as IHTMlDocument2;

htmldocument.body.innerHTML :=EmailStr;

Result:=True;

except

end;

end;

//->html

function TShowEmailInfoFrm.ShowEmailInfo(): WildString;

var

htmldocument : ihtmldocument2;

begin

try

htmldocument := EmailBrower.Document as IHTMlDocument2;

result:=htmldocument.body.innerHTML ;

except

end;

end;

procedure TShowEmailInfoFrm.FormCreate(Sender: TObject);

begin

EmailBrower.Navigate(''about:blank'');

EmailBrower.Navigate(''你的url'');

end;

4樓: 用idhttp

5樓: function UrlGetStr(const URL: string; ShowHeaders: boolean = false): string;

{--------------獲取網頁代碼函數-----------------}

const

Agent = ''Internet Explorer 6.0'';

var

hFile, HInet: HINTERNET;

Buffer: array[0..32767] of Char;

BufRead: Cardinal;

BufSize: Cardinal;

TempStream: TStringStream;

dwIndex: dword;

begin

HInet := InternetOpen(PChar(Agent), INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);

if Assigned(HInet) then

try

if LowerCase(Copy(URL,1,7)) <> ''http://'' then

hFile := InternetOpenUrl(HInet, PChar(''http://'' + URL), nil, 0, 0, 0)

else

hFile := InternetOpenUrl(HInet, PChar(URL), nil, 0, 0, 0);

TempStream := TStringStream.Create('''');

dwIndex := 0;

BufSize := SizeOf(Buffer);

HttpQueryInfo(hfile, HTTP_QUERY_RAW_HEADERS_CRLF, @Buffer, BufSize, dwIndex);

if ShowHeaders then TempStream.Write(Buffer, BufSize);

if Assigned(hFile) then

try

with TempStream do

try

while InternetReadFile(hFile, @Buffer, BufSize, BufRead) and (BufRead > 0) do

Write(Buffer, BufRead);

Result := DataString;

finally

Free;

end;

finally

InternetCloseHandle(hFile);

end;

finally

InternetCloseHandle(hinet);

end;

end;

6樓: 用IdHTTP組件應該是最簡的,

s: TStringStream;

IdHTTP.Get(''http://www.sohu.com'',s);

ShowMessage(s.DataString);

銷售管理軟件版7樓: 我剛剛做了一個.很簡單的.用IdHttp的Get方法.再用多線程.速度可以很快的.

8樓: 多人接受答案了。

總結

以上是生活随笔為你收集整理的html如何获得网址,已知一个网址,如何获得该网址对应的html源代码?在del 找人事管理软件...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。