<p>asp fso删除文件DeleteFile与文件夹DeleteFolder<br /> &#39;==============================<br /> &#39;函 数 名:DelFolder<br /> &#39;作 用:删除文件夹<br /> &#39;参 数:文件夹相对路径FolderPath<br /> &#39;==============================<br /> Function DelFolder(FolderPath)<br /> If IsFolder(FolderPath)=True Then<br /> Set Fso=Server.CreateObject(&quot;Scri&quot;&amp;&quot;pting.File&quot;&amp;&quot;Sys&quot;&amp;&quot;temObject&quot;)<br /> Fso.DeleteFolder(Server.MapPath(FolderPath))<br /> Set Fso=Nothing<br /> End If<br /> &#39; Select Case Err <br /> &#39; Case 424 Response.Write(&quot;方卡错误提示:删除&quot;&amp;FolderPath&amp;&quot;文件夹时,路径未找到或者该目录没有写入权限!&quot;)<br /> &#39; End Select<br /> End Function<br /> <br /> &#39;==============================<br /> &#39;函 数 名:DelFile<br /> &#39;作 用:删除文件<br /> &#39;参 数:文件相对路径FilePath<br /> &#39;==============================<br /> Function DelFile(FilePath)<br /> &#39; On Error Resume Next<br /> If IsFile(FilePath)=True Then<br /> Set Fso=Server.CreateObject(&quot;Scri&quot;&amp;&quot;pting.File&quot;&amp;&quot;Sys&quot;&amp;&quot;temObject&quot;)<br /> Fso.DeleteFile(Server.MapPath(FilePath))<br /> Set Fso=Nothing<br /> End If<br /> &#39; Select Case Err <br /> &#39; Case 424 Response.Write(&quot;方卡错误提示:删除&quot;&amp;FilePath&amp;&quot;文件时,路径未找到或者该目录没有写入权限!&quot;)<br /> &#39; End Select<br /> End Function</p>
T:0.008008s,M:245.77 KB
返回顶部 留言