귀하는 손님 이십니다
로그인
회원가입
  
  델마당 공식 은행계좌
  하나은행 227-910235-83607
  예금주 이상국(운영진)
프로젝트 게시판
투표게시판
델마당소개
기초부터 활용까지! 델파이 교육 - 데브기어
 광고문의 :
吏덈Ц怨 떟蹂 吏덈Ц怨 떟蹂 입니다.
글내용 - 吏덈Ц怨 떟蹂
 [떟蹂] WinHttp.ResponseText 븳湲 源⑥쭚 쁽긽
coding
(沅뚯닚샇)
2019-03-12 삤썑 5:39:07
369회 조회


등록된 파일이 없습니다.
>> 1. 媛쒕컻/떎뻾 뵆옯뤌 
>>   (1) OS : 
>>   (2) 媛쒕컻댋 : 뜽뙆씠7
>>   (3) 궗슜 Database : 
>> 
>> 2. 媛쒕컻 以묒씤 봽濡쒓렇옩 
>> 
>> 3. 吏덈Ц 궡슜 
>> WinHttp瑜 궗슜븯뿬 쎒궗씠듃뿉꽌 뜲씠꽣瑜 異쒕젰븯硫 븳湲씠 씠젃寃 源⑥쭛땲떎..
>> 
>> [i??e??i?쨈i?쨔e째궗] DIY i??i占≤e?? i?짯e쨀關e쨋?+i쨔쨈
>> 
>> Content-Type씠굹 Encoding벑 떎 留욎떠二쇱뼱룄 씠젃寃 굹삤꽕슂.. 샊떆 븘떆뒗 遺 엳쓣源뚯슂?




delphi 10.3.1

string쓣 由ы꽩븯뒗 ResponseText()濡 씫쑝硫 
뜽뙆씠 RTL뿉 쓽빐꽌 떆뒪뀥 뵒뤃듃 肄붾뱶럹씠吏媛 쟻슜맂
쑀땲肄붾뱶 뒪듃留곸쑝濡 媛뺤젣쟻쑝濡 蹂솚 뤌 踰꾨━뒗 瑗댁씠 맗땲떎.

ResponseText() 濡 씫吏 留먭퀬, 

븘옒 媛숈씠 ResponseBody()瑜 넻빐꽌 OLE Variant Stream쑝濡 씫뼱슂.


procedure TForm1.Button1Click(Sender: TObject);
var
  http: IWinHttpRequest;
  ms: TMemoryStream;
  ov: OleVariant;
  Len: Integer;
  sl: TStringList;
begin
  http := CoWinHttpRequest.Create;
  http.Open('GET', 'http://www.wemakeprice.com/deal/adeal/4369974/990200/?source=990200_bbanner',false);
  http.Send('');
  http.WaitForResponse(30);

  ov := http.ResponseBody;

  try
    ms := TMemoryStream.Create;
    sl := TStringList.Create;
    Len := VarArrayHighBound(ov,1) - VarArrayLowBound(ov,1) + 1;
    ms.WriteBuffer(PByteArray(VarArrayLock(ov))^, Len);
    ms.Position := 0;
    sl.LoadFromStream(ms, TEncoding.UTF8);
    Memo1.Lines.Text := sl.Text;
  finally
    VarArrayUnlock(ov);
    sl.Destroy;
    ms.Destroy;
  end;
end;


硫붿씤 벐젅뱶媛 釉붾윭궧 릺吏 븡寃 븯젮硫 鍮꾨룞湲곕줈 泥섎━빐꽌 씫쑝硫 맗땲떎.




異쒕젰:...............................

<!doctype html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="robots" content="all" />
<meta name="author" content="Copyright &copy; WEMAKEPRICE Corporation. All Rights Reserved." />
<meta property="og:title" content="[33뜲씠] 젣二 븘荑좎븘뵆씪꽬 19,333썝 뼳 援ш꼍븯윭媛湲"/>
<meta property="og:type" content="website">
<meta property="og:url" content="http://www.wemakeprice.com/deal/adeal/4369974/?utm_source=facebook&utm_medium=sns&utm_campaign=4369974&src=text&kw=02409F"/>
<meta property="og:image" content="http://img.wemep.co.kr/deal/4/997/4369974/b5868b7585423eac45d9159cde71d655df696c49.jpg?1552372701"/>
<meta property="og:site_name" content="WeMakePrice"/>
<meta property="og:description" content="33뜲씠 룷씤듃쟻由썩쁾4썡씠슜OK"/>
<meta property="og:locale:alternate" content="ko_KR" />
<meta property="fb:admins" content="100001387730991"/>
<meta property="fb:app_id" content="122691617829067" />
<meta name="naver-site-verification" content="4175bd2f9e509ec103823741b5b564d65e395046"/>
<meta name="description" content="냼뀥而ㅻ㉧뒪, 썝뜑諛곗넚, 뙣뀡/酉고떚, 떇뭹/깮솢/쑀븘룞, 媛쟾/뵒吏꽭, 뿬뻾/젅, 吏뿭/而ъ쿂 븷씤">
<title>[33뜲씠] 젣二 븘荑좎븘뵆씪꽬 - 듅媛몴! 쐞硫뷀봽</title>
<link rel="shortcut icon" href="http://img.wemep.co.kr/favicon_v01.ico" />

............................................