Scripting Runtime Library(FileSystemObject)
Àӽà ÆÄÀÏÀ̳ª Æú´õ°¡ ÇÊ¿äÇÑ ¿¬»êÀ» ¼öÇàÇÏ´Â µ¥ À¯¿ëÇÑ ÀÓÀ¸·Î ¸¸µç Àӽà ÆÄÀÏÀ̳ª Æú´õ À̸§À» ¹ÝȯÇÑ´Ù.
ÇʼöÀûÀÎ object ÂüÁ¶´Â Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.
ÆĶó¸ÞÅÍ´Â ¾ø´Ù.
¹Ýȯ°ª sNameÀº Àӽà ÆÄÀÏÀ̳ª Æú´õÀÇ À̸§À» ³ªÅ¸³»´Â ¹®ÀÚ¿ÀÌ´Ù.
GetTempName ¸Þ¼µå´Â ÆÄÀÏÀ» ¸¸µéÁö´Â ¾Ê´Â´Ù.
´ÜÁö ÆÄÀÏÀ» ¸¸µé±â À§ÇØ CreateTextFile°ú ÇÔ²² »ç¿ëµÇ´Â Àӽà ÆÄÀÏ À̸§¸¸ Á¦°øÇÑ´Ù.
<SCRIPT language=JScript> function GetTempNameTest(){ var fso,tmpFolder,tmpFile,tmpName,TemporaryFolder=2; fso=new ActiveXObject('Scripting.FileSystemObject'); tmpFolder=fso.GetSpecialFolder(TemporaryFolder); tmpName=fso.GetTempName(); tmpFile=tmpFolder.CreateTextFile(tmpName); tmpFile.WriteLine('¿¹Á¦¸¦ À§ÇÑ ÈÀÏ ³»¿ëÀÌ´Ù.'); tmpFile.Close(); str='Àӽà Æú´õ "'+tmpFolder+'"¿¡<BR>Àӽà ÆÄÀÏ "'+tmpName+'"ÀÌ »ý¼ºµÇ¾ú´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=GetTempNameTest()"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>GetTempName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function GetTempNameTestvb Dim fso,tmpFolder,tmpName,tmpFile Const TemporaryFolder=2 Set fso=CreateObject("Scripting.FileSystemObject") Set tmpFolder=fso.GetSpecialFolder(TemporaryFolder) tmpName=fso.GetTempName Set tmpFile=tmpFolder.CreateTextFile(tmpName) tmpFile.WriteLine "¿¹Á¦¸¦ À§ÇÑ ÈÀÏ ³»¿ëÀÌ´Ù." tmpFile.Close str="Àӽà Æú´õ '"&tmpFolder&"'¿¡<BR>ÀÓ½ÃÆÄÀÏ '"&tmpName&"'ÀÌ »ý¼ºµÇ¾ú´Ù." GetTempNameTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetTempNameTestvb()"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>GetTempName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>