유돌이

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Notice

2008. 12. 29. 23:26 델파이

WinInet.pas 유닛에 정의되어있는
function InternetGetCookie;  function InternetSetCookie; 

를 이용 하면 됩니다.

 

;
procedure TForm1.btnSetCookieClick(Sender: TObject);
var
   sCookieVal: string;
   bRet: boolean;
begin
   bRet := InternetSetCookie('http://www.delphi.co.kr/'nil'myname=nilriri;');
   if not bRet then
      Showmessage('fail');
end;

 


procedure TForm1.Button2Click(Sender: TObject);
var
   sURL: array[0..255] of char;
   sCookieVal: array[0..255] of char;
   pCookieVal: PAnsiChar;

   iSize: LongWord;
   bRet: boolean;

begin
   sUrl := 'http://www.delphi.co.kr/';

   pCookieVal := @sCookieVal;
   iSize := 255;

   bRet := InternetGetCookie(sUrl, nil, pCookieVal, iSize);

   if bRet then
      Showmessage(pCookieVal);

end;

<!--CodeE-->

'델파이' 카테고리의 다른 글

구분자(delimiter)를 사용한 문자열 파싱(parsing)  (0) 2008.12.29
OleVariant 형을 스트링으로 변환하는 방법  (0) 2008.12.29
파일 찾기  (0) 2008.12.24
실행파일 삭제  (0) 2008.12.24
키보드 이벤트[keybd_event  (0) 2008.12.24
posted by 유돌이