更新时间:2022-11-17 16:15:53
VB:
VB:
Private Sub DeletFilesAndFolder()
Dim path As String = "C:\Documents and Settings\prasad\Desktop\folder"
If Directory.Exists(path) Then
Directory.Delete(path, True)
Else
Console.WriteLine(path & " not exists")
End If
End Sub
C#:
C#:
private void DeletFilesAndFolder()
{
string path = @"C:\Documents and Settings\prasad\Desktop\folder";
if (Directory.Exists(path))
Directory.Delete(path, true);
else
Console.WriteLine(path + " not exists");
}