file 不行!
string target = @"d:\TestDir\1.jpg";
try
{
if (Directory.Exists(target))
{
Directory.Delete(target, true);
}
}
catch (Exception ex)
{
string a = "";
a = ex.Message;
}
folder 可以!
string target = @"d:\TestDir";
try
{
if (Directory.Exists(target))
{
Directory.Delete(target, true);
}
}
catch (Exception ex)
{
string a = "";
a = ex.Message;
}