diff --git a/Rs.Framework/DirectoryHelper.cs b/Rs.Framework/DirectoryHelper.cs
new file mode 100644
index 0000000..98d3997
--- /dev/null
+++ b/Rs.Framework/DirectoryHelper.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Rs.Framework
+{
+ public static class DirectoryHelper
+ {
+ ///
+ /// 移动文件夹的只读属性
+ ///
+ /// 文件夹路径
+ /// 是否包含文件
+ /// 是否包含子文件夹
+ public static void RemoveReadOnlyAttribute(string dirPath,bool containFile=false,bool recursive=false)
+ {
+ if (!string.IsNullOrEmpty(dirPath))
+ {
+ DirectoryInfo di = new DirectoryInfo(dirPath);
+ if(di!=null)
+ {
+ di.Attributes = FileAttributes.Normal & FileAttributes.Directory;
+ if (containFile)
+ {
+ //查找所有的文件
+ string[] files = Directory.GetFiles(dirPath);
+ if (files != null && files.Length > 0)
+ {
+ foreach (string f in files)
+ {
+ File.SetAttributes(f, FileAttributes.Normal);
+ }
+ }
+ }
+ if (recursive)
+ {
+ //查找所有的文件夹
+ string[] dirs = Directory.GetDirectories(dirPath);
+ if (dirs != null && dirs.Length > 0)
+ {
+ foreach (string d in dirs)
+ {
+ RemoveReadOnlyAttribute(d);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Rs.Framework/Rs.Framework.csproj b/Rs.Framework/Rs.Framework.csproj
index 92cdea0..e666ff7 100644
--- a/Rs.Framework/Rs.Framework.csproj
+++ b/Rs.Framework/Rs.Framework.csproj
@@ -58,6 +58,7 @@
+