Dim fso
        fso = CreateObject("Scripting.FileSystemObject")
        fso.DeleteFolder("d:\vb\vb")
上面是我写的代码,是在vs2005中建立的控制台vb程序,上面是伤处文件夹的代码,但是编译没有问题,运行时候老是出现如下错误,刚开始学vb,请各位大神帮帮小弟,三行代码所处的行号分别是18,19,20.如果这个办法不行,有没有其他办法可以实现删除文件夹的办法,文件夹中可能还包含文件夹和文件。
Unhandled Exception: System.Security.SecurityException: Exception from HRESULT:
0x800A0046 (CTL_E_PERMISSIONDENIED)
   at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object
 o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] Cop
yBack, Boolean IgnoreReturn)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Inst
ance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames,
Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
   at vb1.Module1.Main() in E:\C++program\vb1\vb1\Module1.vb:line 20
The Zone of the assembly that failed was:
MyComputer
请按任意键继续. . .