³¯Â¥: 1996-05-06 | ±Û¾´ÀÌ: µµ¾Æ | 44179 ¹ø | ÇÁ¸°Æ® | ¸ÞÀϷκ¸³»±â

ÆÞ ÀÀ¿ë - Á¦ 6°­ Win32::Internet »ç¿ëÀÚ ±æÀâÀÌ


»ç¿ëÀÚ ±æÀâÀÌ
ÀÌ ¸ðµâÀ» »ç¿ëÇϱâÀ§ÇØ ½ºÅ©¸³Æ®ÀÇ Ã¹ÁÙ¿¡ ´ÙÀ½°ú °°Àº ÇàÀ» Ãß°¡ÇØ¾ß ÇÑ´Ù:
use Win32::Internet;
±×¸®°í ´ÙÀ½ ¸í·ÉÀ¸·Î ÀÎÅÍ³Ý Á¢¼ÓÀ» ¿­¾î¾ß ÇÑ´Ù:
$Connection = new Win32::Internet();
ÀÌ °ÍÀº ÀÌ ¸ðµâÀÇ ÀÓÀÇÀÇ ÇÔ¼ö¸¦ »ç¿ëÇϱâÀ§ÇØ ÇÊ¿äÇÏ´Ù. ÀÌ °ÍÀ¸·Î ÆÞ³»¿¡ Internet °³Ã¼°¡ »ý¼ºµÇ¸ç ÀÌ °³Ã¼·Î ³ªÁß¿¡ ¼³¸íÇÒ ÀÎÅÍ³Ý ÇÔ¼ö¸¦ µ¿ÀÛ½Ãų ¼ö ÀÖ´Ù. »ç¿ëÇÒ ¼ö ÀÖ´Â °³Ã¼´Â ´ÙÀ½°ú °°´Ù:
  • ÀÎÅÍ³Ý Á¢¼Ó(ÁÖ °³Ã¼, new¸¦ º»´Ù.)
  • URL(OpenURLÀ» º»´Ù.)
  • FTP ¼¼¼Ç(FTPÀ» º»´Ù.)
  • HTTP ¼¼¼Ç(HTTPÀ» º»´Ù.)
  • HTTP ¿äû(OpenRequestÀ» º»´Ù)
ÆÞÀÇ °ü·Ê¿¡µû¶ó ÀÌ È®Àå¿¡¼­µµ °°Àº °ÍÀ» ÇÏ´Â ¼­·Î ´Ù¸¥ ¹æ¹ýÀÌ Á¸ÀçÇÑ´Ù; »ç½Ç Win32 ÀÎÅÍ³Ý ÇÔ¼ö¸¦ ±¸ÇöÇÏ´Â ´Ù¸¥ ¼öÁØÀÇ ÇÔ¼ö°¡ Á¸ÀçÇÑ´Ù. ¸î¸î ·çƾÀº ÇϹøÀÇ È£Ãâ·Î º¹ÀâÇÑ ÀÛ¾÷À» ¼öÇàÇϱâÀ§ÇØ ¿©·¯ Win32 API ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù; ¹°·Ð À̵éÀÌ »ç¿ëÇϱ⠰£´ÜÇÏÁö¸¸ ±â´ÉÀº ´Ù¼Ò ¶³¾îÁø´Ù. ´ÜÁö API ÇÔ¼ö¸¦ ±¸ÇöÇÑ ´Ù¸¥ ÇÔ¼ö°¡ Á¸ÀçÇÏ¸ç µû¶ó¼­ À̵éÀÌ °¡Áö°í ÀÖ´Â ¸ðµç °­·ÂÇÑ ±â´ÉÀ» »ç¿ëÇÒ ¼ö ÀÖ´Ù. ±×·¯³ª ¸î¸î Ãß°¡ÀûÀÎ ÇÁ·Î±×·¡¹Ö ´Ü°è¸¦ ´õ ¿ä±¸ÇÑ´Ù. ¿¹·Î¼­ HTTP, FTP, GOPHERÀÇ URLÀ» °¡Á®¿À´Âµ¥ »ç¿ëÇÒ ¼ö ÀÖ´Â FetchURLÀ̶ó´Â ÇÔ¼ö´Â ´ÙÀ½°ú °°Àº °£´ÜÇÑ ¸í·ÉÀ¸·Î °¡´ÉÇÏ´Ù:
$INET = new Win32::Internet();
$file = $INET->FetchURL("http://www.yahoo.com");
´ÙÀ½ ¹æ¹ýÀ» »ç¿ëÇؼ­µµ µ¿ÀÏÇÑ °á°ú¸¦ ¾òÀ» ¼ö ÀÖ´Ù(ÀÌ°ÍÀº »ç½Ç FetchURL¿¡ÀÇÇØ ¼öÇàµÈ °ÍÀÌ´Ù):
$INET = new Win32::Internet();
$URL = $INET->OpenURL("http://www.yahoo.com");
$file = $URL->ReadFile();
$URL->Close();
¶ÇÇÑ ¿ÏÀüÇÑ HTTP ¼¼¼ÇÀ» ¿­ ¼öµµ ÀÖ´Ù:
$INET = new Win32::Internet();
$HTTP = $INET->HTTP("www.yahoo.com", "anonymous", "[email protected]");
($statuscode, $headers, $file) = $HTTP->Request("/");
$HTTP->Close();
¸¶Áö¸·À¸·Î HTTP ¿äûÀ» ÇϱâÀ§ÇØ »ç¿ëµÉ ¼öµµ ÀÖ´Ù:
$INET = new Win32::Internet();
$HTTP = $INET->HTTP("www.yahoo.com", "anonymous", "[email protected]");
$HTTP->OpenRequest($REQ, "/");
$REQ->AddHeader("If-Modified-Since: Saturday, 16-Nov-96 15:58:50 GMT");
$REQ->SendRequest();
$statuscode = $REQ->QueryInfo("",HTTP_QUERY_STATUS_CODE);
$lastmodified = $REQ->QueryInfo("Last-Modified");
$file = $REQ->ReadEntireFile();
$REQ->Close();
$HTTP->Close();
¿ÏÀüÇÑ FTP ¼¼¼ÇÀ» ¿­°í, Á¦¾îÇϱâÀ§ÇØ ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÑ´Ù:
$Connection->FTP($Session, "ftp://ftp.activeware.com", 
	"anonymous", "[email protected]");
ÀÌ °ÍÀ¸·Î ÀÌ ÆÐÅ°Áö¿¡ÀÇÇØ Á¦°øµÇ´Â FTP ÇÔ¼ö¸¦ Àû¿ëÇÒ ¼ö ÀÖ´Â ÆÞ °³Ã¼°¡ »ý¼ºµÈ´Ù:
$Session->Cd("/ntperl/perl5.001m/CurrentBuild");
$Session->Ascii();
$Session->Get("110-i86.zip");
$Session->Close();
º¸´Ù º¹ÀâÇÑ ¿¹´Â ÀÌ ÆÐÅ°Áö¿¡ Æ÷ÇԵǾî ÀÖ´Â TEST.PLÀ» ÂüÁ¶Çϱ⠹ٶõ´Ù.


´ÙÀ½±Û: ÆÞ ÀÀ¿ë - Á¦ 7°­ Win32::Internet ºÎ·Ï (14757)1996-05-08
ÀÌÀü±Û: ÆÞ ÀÀ¿ë - Á¦ 5°­ Win32::Internet ¼Ò°³ (9767)1996-05-05
´ÙÀ½ÆäÀÌÁö (2/4) >>

¼¼»ó»ç´Â À̾߱â



RSS ±¸µ¶ (À͸í | ȸ¿ø | °­Á | Æ÷·³)
(C) 1996 ~ 2017 QAOS.com All rights reserved.