Scripting Runtime Library(FileSystemObject)

Àӽà ÆÄÀÏÀ̳ª Æú´õ°¡ ÇÊ¿äÇÑ ¿¬»êÀ» ¼öÇàÇÏ´Â µ¥ À¯¿ëÇÑ ÀÓÀ¸·Î ¸¸µç Àӽà ÆÄÀÏÀ̳ª Æú´õ À̸§À» ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
object

ÇʼöÀûÀÎ object ÂüÁ¶´Â Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.

ÆĶó¸ÞÅÍ

ÆĶó¸ÞÅÍ´Â ¾ø´Ù.

¹Ýȯ°ª

¹Ýȯ°ª sNameÀº Àӽà ÆÄÀÏÀ̳ª Æú´õÀÇ À̸§À» ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

¼³¸í

GetTempName ¸Þ¼­µå´Â ÆÄÀÏÀ» ¸¸µéÁö´Â ¾Ê´Â´Ù.
´ÜÁö ÆÄÀÏÀ» ¸¸µé±â À§ÇØ CreateTextFile°ú ÇÔ²² »ç¿ëµÇ´Â Àӽà ÆÄÀÏ À̸§¸¸ Á¦°øÇÑ´Ù.


GetTempName ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript GetTempName ¸Þ¼­µå ¿¹Á¦
<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>
°á°ú Ç¥½Ãâ
VBScript GetTempName ¸Þ¼­µå ¿¹Á¦
<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>