Scripting Runtime Library(TextStream)
TextStream ÆÄÀÏ¿¡ ÁöÁ¤ÇÑ ¼ö¸¸Å ÁÙ ¹Ù²Þ ¹®ÀÚ¸¦ ¾´´Ù
¹Ýȯ°ªÀº ¾ø´Ù.
TextStream ÆÄÀÏ¿¡ ÁöÁ¤ÇÑ ¼ö¸¸Å ÁÙ ¹Ù²Þ ¹®ÀÚ¸¦ ¾´´Ù
<SCRIPT language=JScript> function WriteBlankLinesTest(filePath){ var fso,fileObj,str=''; var ForReading=1,ForWriting=2; fso=new ActiveXObject('Scripting.FileSystemObject'); if (fso.FileExists(filePath)) fso.DeleteFile(filePath); fileObj=fso.OpenTextFile(filePath,ForWriting,true); fileObj.WriteLine('¿¹Á¦¸¦ À§ÇÑ ÆÄÀÏÀÌ´Ù.'); fileObj.WriteBlankLines(1); fileObj.WriteLine('1234567890\n987654321'); fileObj.WriteBlankLines(2); fileObj.WriteLine('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); fileObj.WriteBlankLines(1); fileObj.Close(); str+='¿¹Á¦¸¦ À§ÇÑ '+filePath+' ÆÄÀÏÀ» »ý¼ºÇÏ¿´´Ù.<BR><BR>'; fileObj=fso.OpenTextFile(filePath,ForReading); str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; str+='fileObj.ReadLine()='+fileObj.ReadLine()+'<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML=WriteBlankLinesTest('C:\\JsTest\\CreateText.txt')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>WriteBlankLines</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function WriteBlankLinesTestvb(filePath) Const ForReading=1,ForWriting=2,ForAppending=8 Dim fso,fileObj,str Set fso=CreateObject("Scripting.FileSystemObject") If fso.FileExists(filePath) Then fso.DeleteFile(filePath) End If Set fileObj=fso.OpenTextFile(filePath,ForWriting,True) fileObj.Write "¿¹Á¦¸¦ À§ÇÑ ÆÄÀÏÀÌ´Ù." fileObj.WriteBlankLines 1 fileObj.Write "1234567890" fileObj.WriteBlankLines 1 fileObj.Write "987654321" fileObj.WriteBlankLines 2 fileObj.Write "ABCDEFGHIJKLMNOPQRSTUVWXYZ" fileObj.WriteBlankLines 1 fileObj.Close str=str&"¿¹Á¦¸¦ À§ÇÑ "&filePath&" ÆÄÀÏÀ» »ý¼ºÇÏ¿´´Ù.<BR><BR>" Set fileObj=fso.OpenTextFile(filePath,ForReading) str=str&"fileObj.ReadLine="&fileObj.ReadLine&"<BR>" str=str&"fileObj.ReadLine="&fileObj.ReadLine&"<BR>" str=str&"fileObj.ReadLine="&fileObj.ReadLine&"<BR>" str=str&"fileObj.ReadLine="&fileObj.ReadLine&"<BR>" str=str&"fileObj.ReadLine="&fileObj.ReadLine&"<BR>" WriteBlankLinesTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=WriteBlankLinesTestvb('C:\\JsTest\\CreateText.txt')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>WriteBlankLines</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>