<p>创建文件夹名称</p> <p>&lt;%<br /> Foldertocreate=server.mappath(&quot;&quot;) &amp;&quot;/cgi-bin/myfiles&quot; <br /> Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br /> Set a = fs.CreateFolder(Foldertocreate) <br /> Set fs=nothing<br /> %&gt;<br /> Done<br /> <br /> 删除文件<br /> &lt;%<br /> Foldertodelete=server.mappath(&quot;&quot;) &amp;&quot;/cgi-bin/111cn&quot; <br /> Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br /> fs.DeleteFolder(Foldertodelete) <br /> Set fs=nothing<br /> %&gt;<br /> Done</p> <p>删除文件夹,判断文件存在时再删除.<br /> &lt;%<br /> Foldertodelete=server.mappath(&quot;&quot;) &amp;&quot;/cgi-bin/myfiles&quot; <br /> Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)<br /> if fs.FolderExists(&quot;c:temp&quot;) then<br /> fs.DeleteFolder &quot;c:temp&quot;<br /> end if<br /> Set fs=nothing<br /> %&gt;</p>
T:0.006696s,M:245.08 KB
返回顶部 留言