End Sub
''删除目录过程
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
''声明Directory类
Dim dircre As System.IO.Directory
''声明文件目录的路径,改路径为物理绝对路径
Dim dir As String = Server.MapPath( ".") + "\Testfolder\"
Try
''判断该文件目录是否存在
If dircre.Exists(dir) Then
''利用Directory类的CreateDirectory方法删除该目录
'' Directory类的Delete方法只能删除空目录,当该目录内有文件时,删除就会出错!
dircre.Delete(dir)
'' dircre.CreateDirectory(dir)
''弹出对话框,提示创建成功!
Response.Write( "<script> alert(''Testfolder目录已经成功删除!'');</script>")
Else
Response.Write( "<script> alert(''Testfolder目录不存在!'');</script>")
&n