TextStream ÆÄÀÏ¿¡¼ ÇöÀç ÁÙ ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.
object´Â Ç×»ó TextStream °³Ã¼ÀÇ À̸§ÀÌ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº 1ÀÌ´Ù.
TextStream ÆÄÀÏ¿¡¼ ÇöÀç ¹®ÀÚ°¡ ÀÖ´Â À§Ä¡ÀÇ ÁÙ ¹øÈ£¸¦, ´Ù½Ã ¸»Çؼ ¼öÁ÷ À§Ä¡¸¦ ±ÛÀÚ¼ö·Î ¹ÝȯÇÑ´Ù.
ÁٹٲÞÇÏ¸é ´ÙÀ½ ÁÙ Á¦ÀÏ ÁÂÃøÀ§Ä¡·Î À̵¿ÇϹǷÎ, ÁÙ ¹Ù²Þ ¹®ÀÚ¸¦ ¾´ ´ÙÀ½ ´Ù¸¥ ¹®ÀÚ´Â ¾²Áö ¾Ê¾Ò´Ù¸é ColumnÀº 1ÀÌ µÇ¾î Ãʱâȵȸç, Line °ªÀº 1 Áõ°¡µÈ´Ù.
Line°ú ColumnÀÇ Á¶ÇÕÀ¸·Î ¹®ÀÚ¿ ÈÀÏ¿¡¼ À§Ä¡¸¦ ¾Ë ¼ö ÀÖ´Ù.
óÀ½ ÆÄÀÏÀ» ¿¬ ´ÙÀ½ ¾Æ¹« ³»¿ëµµ ¾²Áö ¾Ê¾Ò´Ù¸é Line°ú ColumnÀº °¢°¢ 1ÀÌ´Ù.
<SCRIPT language=JScript> function GetLine(){ var fso,fileObj,allread filePath='c:\\JsTest\\LineTestFile.txt'; var ForReading=1,ForWriting=2; fso=new ActiveXObject('Scripting.FileSystemObject') fileObj=fso.OpenTextFile(filePath,ForWriting,true) fileObj.WriteLine('¾È³çÇϼ¼¿ä'); fileObj.WriteLine('¹è¿ì´Â °ÍÀº Áñ°Ì´Ù'); fileObj.Close(); fileObj=fso.OpenTextFile(filePath,ForReading); allread=fileObj.ReadAll(); return(fileObj.Line); } </SCRIPT>
function GetLinevb Dim fso,fileObj,allread filePath="c:\\JsTest\\LineTestFile.txt" Const ForReading=1,ForWriting=2 Set fso=CreateObject("Scripting.FileSystemObject") Set fileObj=fso.OpenTextFile(filePath,ForWriting,true) fileObj.Write "¾È³çÇϼ¼¿ä"&vbCrLf&"¹è¿ì´Â °ÍÀº Áñ°Ì´Ù"&vbCrLf Set fileObj=fso.OpenTextFile(filePath,ForReading) allread=fileObj.ReadAll GetLinevb=fileObj.Line End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetLinevb('b')">VBScript <SPAN class=property>Line</SPAN>