Scripting Runtime Library(TextStream)

TextStream ÆÄÀÏ¿¡¼­ ÇöÀç ÁÙ ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.

Àμö
object : (°³Ã¼)

object´Â Ç×»ó TextStream °³Ã¼ÀÇ À̸§ÀÌ´Ù.

: (¼Ó¼º Á¤¼ö°ª)
¼Ó¼º°ªÀº TextNode °³Ã¼ÀÇ ±ÛÀÚ¼ö¸¦ ³ªÅ¸³»´Â Á¤¼ö°ªÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº 1ÀÌ´Ù.

¼³¸í

TextStream ÆÄÀÏ¿¡¼­ ÇöÀç ¹®ÀÚ°¡ ÀÖ´Â À§Ä¡ÀÇ ÁÙ ¹øÈ£¸¦, ´Ù½Ã ¸»Çؼ­ ¼öÁ÷ À§Ä¡¸¦ ±ÛÀÚ¼ö·Î ¹ÝȯÇÑ´Ù.

ÁٹٲÞÇÏ¸é ´ÙÀ½ ÁÙ Á¦ÀÏ ÁÂÃøÀ§Ä¡·Î À̵¿ÇϹǷÎ, ÁÙ ¹Ù²Þ ¹®ÀÚ¸¦ ¾´ ´ÙÀ½ ´Ù¸¥ ¹®ÀÚ´Â ¾²Áö ¾Ê¾Ò´Ù¸é ColumnÀº 1ÀÌ µÇ¾î ÃʱâÈ­µÈ¸ç, Line °ªÀº 1 Áõ°¡µÈ´Ù.

Line°ú ColumnÀÇ Á¶ÇÕÀ¸·Î ¹®ÀÚ¿­ È­ÀÏ¿¡¼­ À§Ä¡¸¦ ¾Ë ¼ö ÀÖ´Ù.

óÀ½ ÆÄÀÏÀ» ¿¬ ´ÙÀ½ ¾Æ¹« ³»¿ëµµ ¾²Áö ¾Ê¾Ò´Ù¸é Line°ú ColumnÀº °¢°¢ 1ÀÌ´Ù.


Line ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
Jscript Item ¿¹Á¦
<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>

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
Jscript Item ¿¹Á¦
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>