/// <summary> /// 删除文件夹 /// </summary> /// <param name="strPath">文件夹路径</param> /// <returns></returns> public static bool DelectDir(string strPath) { try { strPath = @strPath.Trim().ToString();// 清除空格 if (Directory.Exists(strPath)) { Directory.Delete(strPath, true); } return true;// 成功 } catch (Exception Exp) // 异常处理 { System.Diagnostics.Debug.Write(Exp.Message.ToString());// 异常信息 return false;// 失败 } }
标签:return,删除,C#,文件夹,ToString,Directory,strPath From: https://www.cnblogs.com/lydj/p/17123879.html