NewLife/X

完成复制、粘贴、移动功能,测试文件复制移动通过
大石头 authored at 2016-11-30 16:59:30
f50e7f5
Tree
1 Parent(s) 6d01ae1
Summary: 4 changed files with 440 additions and 116 deletions.
Modified +95 -27
Modified +3 -0
Modified +43 -7
Modified +299 -82
Modified +95 -27
diff --git a/NewLife.Cube/Areas/Admin/Controllers/FileController.cs b/NewLife.Cube/Areas/Admin/Controllers/FileController.cs
index b77bdfa..e0ec083 100644
--- a/NewLife.Cube/Areas/Admin/Controllers/FileController.cs
+++ b/NewLife.Cube/Areas/Admin/Controllers/FileController.cs
@@ -53,12 +53,41 @@ namespace NewLife.Cube.Admin.Controllers
         //    }
         //}
 
+        private FileItem GetItme(String r)
+        {
+            var inf = GetFile(r) as FileSystemInfo ?? GetDirectory(r);
+            if (inf == null) return null;
+
+            var fi = new FileItem();
+            fi.Name = inf.Name;
+            fi.FullName = GetFullName(inf.FullName);
+            fi.Raw = inf.FullName;
+            fi.Directory = inf is DirectoryInfo;
+            fi.LastWrite = inf.LastWriteTime;
+
+            if (inf is FileInfo)
+            {
+                var f = inf as FileInfo;
+                if (f.Length < 1024)
+                    fi.Size = "{0:n0}".F(f.Length);
+                else if (f.Length < 1024 * 1024)
+                    fi.Size = "{0:n2}K".F((Double)f.Length / 1024);
+                else if (f.Length < 1024 * 1024 * 1024)
+                    fi.Size = "{0:n2}M".F((Double)f.Length / 1024 / 1024);
+                else if (f.Length < 1024L * 1024 * 1024 * 1024)
+                    fi.Size = "{0:n2}G".F((Double)f.Length / 1024 / 1024 / 1024);
+            }
+
+            return fi;
+        }
+
         private String GetFullName(String r)
         {
             return r.TrimStart(Root).TrimStart(Root.TrimEnd(Path.DirectorySeparatorChar + ""));
         }
         #endregion
 
+        #region 列表&删除
         /// <summary>文件管理主视图</summary>
         /// <returns></returns>
         public ActionResult Index(String r, String sort)
@@ -69,34 +98,19 @@ namespace NewLife.Cube.Admin.Controllers
             var root = Root.TrimEnd(Path.DirectorySeparatorChar);
             if (!di.FullName.StartsWithIgnoreCase(root)) di = Root.AsDirectory();
 
+            // 计算当前路径
             var fd = di.FullName;
             if (fd.StartsWith(Root)) fd = fd.Substring(Root.Length);
             ViewBag.Current = fd;
 
+            // 遍历所有子目录
             var fis = di.GetFileSystemInfos();
             var list = new List<FileItem>();
             foreach (var item in fis)
             {
                 if (item.Attributes.Has(FileAttributes.Hidden)) continue;
 
-                var fi = new FileItem();
-                fi.Name = item.Name;
-                fi.FullName = GetFullName(item.FullName);
-                fi.Directory = item is DirectoryInfo;
-                fi.LastWrite = item.LastWriteTime;
-
-                if (item is FileInfo)
-                {
-                    var f = item as FileInfo;
-                    if (f.Length < 1024)
-                        fi.Size = "{0:n0}".F(f.Length);
-                    else if (f.Length < 1024 * 1024)
-                        fi.Size = "{0:n2}K".F((Double)f.Length / 1024);
-                    else if (f.Length < 1024 * 1024 * 1024)
-                        fi.Size = "{0:n2}M".F((Double)f.Length / 1024 / 1024);
-                    else if (f.Length < 1024L * 1024 * 1024 * 1024)
-                        fi.Size = "{0:n2}G".F((Double)f.Length / 1024 / 1024 / 1024);
-                }
+                var fi = GetItme(item.FullName);
 
                 list.Add(fi);
             }
@@ -126,7 +140,10 @@ namespace NewLife.Cube.Admin.Controllers
                 });
             }
 
-            return View(list);
+            // 剪切板
+            ViewBag.Clip = GetClip();
+
+            return View("Index", list);
         }
 
         /// <summary>删除</summary>
@@ -152,6 +169,7 @@ namespace NewLife.Cube.Admin.Controllers
 
             return RedirectToAction("Index", new { r = p });
         }
+        #endregion
 
         #region 压缩与解压缩
         /// <summary>压缩文件</summary>
@@ -231,10 +249,10 @@ namespace NewLife.Cube.Admin.Controllers
 
         #region 复制粘贴
         private const String CLIPKEY = "File_Clipboard";
-        private ICollection<String> GetClip()
+        private List<FileItem> GetClip()
         {
-            var list = Session[CLIPKEY] as ICollection<String>;
-            if (list == null) Session[CLIPKEY] = list = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
+            var list = Session[CLIPKEY] as List<FileItem>;
+            if (list == null) Session[CLIPKEY] = list = new List<FileItem>();
 
             return list;
         }
@@ -242,12 +260,31 @@ namespace NewLife.Cube.Admin.Controllers
         /// <summary>复制文件到剪切板</summary>
         /// <param name="r"></param>
         /// <returns></returns>
-        public ActionResult Copy(String r)
+        public ActionResult Copy(String r, String f)
         {
+            var fi = GetItme(f);
+            if (fi == null) throw new Exception("找不到文件或目录!");
+
             var list = GetClip();
-            if (!list.Contains(r)) list.Add(r);
+            if (!list.Any(e => e.Raw == fi.Raw)) list.Add(fi);
 
-            return RedirectToAction("Index", new { r });
+            //return RedirectToAction("Index", new { r });
+            return Index(r, null);
+        }
+
+        /// <summary>从剪切板移除</summary>
+        /// <param name="r"></param>
+        /// <returns></returns>
+        public ActionResult CancelCopy(String r, String f)
+        {
+            var fi = GetItme(f);
+            if (fi == null) throw new Exception("找不到文件或目录!");
+
+            var list = GetClip();
+            list.RemoveAll(e => e.Raw == fi.Raw);
+
+            //return RedirectToAction("Index", new { r });
+            return Index(r, null);
         }
 
         /// <summary>粘贴文件到当前目录</summary>
@@ -255,14 +292,45 @@ namespace NewLife.Cube.Admin.Controllers
         /// <returns></returns>
         public ActionResult Paste(String r)
         {
-            return RedirectToAction("Index", new { r });
+            var di = GetDirectory(r);
+            if (di == null) throw new Exception("找不到目录!");
+
+            var list = GetClip();
+            foreach (var item in list)
+            {
+                System.IO.File.Copy(item.Raw, di.FullName.CombinePath(item.Name), true);
+            }
+            list.Clear();
+
+            return Index(r, null);
+        }
+
+        /// <summary>移动文件到当前目录</summary>
+        /// <param name="r"></param>
+        /// <returns></returns>
+        public ActionResult Move(String r)
+        {
+            var di = GetDirectory(r);
+            if (di == null) throw new Exception("找不到目录!");
+
+            var list = GetClip();
+            foreach (var item in list)
+            {
+                System.IO.File.Move(item.Raw, di.FullName.CombinePath(item.Name));
+            }
+            list.Clear();
+
+            return Index(r, null);
         }
 
         /// <summary>清空剪切板</summary>
         /// <returns></returns>
         public ActionResult ClearClipboard(String r)
         {
-            return RedirectToAction("Index", new { r });
+            var list = GetClip();
+            list.Clear();
+
+            return Index(r, null);
         }
         #endregion
     }
Modified +3 -0
diff --git a/NewLife.Cube/Areas/Admin/Models/FileItem.cs b/NewLife.Cube/Areas/Admin/Models/FileItem.cs
index 9dae073..4a64c56 100644
--- a/NewLife.Cube/Areas/Admin/Models/FileItem.cs
+++ b/NewLife.Cube/Areas/Admin/Models/FileItem.cs
@@ -15,6 +15,9 @@ namespace NewLife.Cube.Admin
         /// <summary>全路径</summary>
         public String FullName { get; set; }
 
+        /// <summary>原始路径</summary>
+        public String Raw { get; set; }
+
         /// <summary>是否目录</summary>
         public Boolean Directory { get; set; }
 
Modified +43 -7
diff --git a/NewLife.Cube/Areas/Admin/Views/File/Index.cshtml b/NewLife.Cube/Areas/Admin/Views/File/Index.cshtml
index 8ebadb9..e00f8e3 100644
--- a/NewLife.Cube/Areas/Admin/Views/File/Index.cshtml
+++ b/NewLife.Cube/Areas/Admin/Views/File/Index.cshtml
@@ -5,6 +5,7 @@
     //ViewBag.Title = "服务器信息";
     var fs = Model as List<FileItem>;
     var r = ViewBag.Current as String;
+    var clips = ViewBag.Clip as ICollection<FileItem>;
 }
 <div class="form-inline">
     <form action="~/Admin/File" id="tool" method="post">
@@ -14,9 +15,9 @@
             </span>
             <input name="r" type="search" id="r" value="@r" class="form-control" placeholder="当前路径" />
             <span class="input-group-btn">
-                <button type="submit" class="btn btn-purple btn-sm">
+                <button type="submit" class="btn btn-primary btn-sm">
                     <span class="glyphicon glyphicon-folder-open icon-on-right bigger-110"></span>
-                    跳转
+                    打开
                 </button>
             </span>
         </div>
@@ -26,20 +27,46 @@
             </span>
             <input name="file" type="file" id="file" placeholder="上传文件" />
             <span class="input-group-btn">
-                <button type="submit" class="btn btn-purple btn-sm" onclick="$('#tool').attr('action', '/Admin/File/Upload');$('#tool').attr('enctype', 'multipart/form-data'); return true;">
+                <button type="submit" class="btn btn-success btn-sm" onclick="$('#tool').attr('action', '/Admin/File/Upload');$('#tool').attr('enctype', 'multipart/form-data'); return true;">
                     <span class="glyphicon glyphicon-plus icon-on-right bigger-110"></span>
                     上传
                 </button>
             </span>
         </div>
+        @if (clips.Count > 0)
+        {
+            <div class="input-group">
+                <span class="input-group-addon">
+                    <i class="glyphicon glyphicon-floppy-disk" title="剪切板共有 @clips.Count 项">@clips.Count</i>
+                </span>
+                <span class="input-group-btn">
+                    <button type="button" class="btn btn-pink btn-sm" onclick="location.href = '/Admin/File/Paste?r=@r';">
+                        <span class="glyphicon glyphicon-floppy-save icon-on-right bigger-110"></span>
+                        粘贴
+                    </button>
+                </span>
+                <span class="input-group-btn">
+                    <button type="button" class="btn btn-gray btn-sm" onclick="location.href = '/Admin/File/Move?r=@r';">
+                        <span class="glyphicon glyphicon-floppy-save icon-on-right bigger-110"></span>
+                        移动
+                    </button>
+                </span>
+                <span class="input-group-btn">
+                    <button type="button" class="btn btn-yellow btn-sm" onclick="location.href = '/Admin/File/ClearClipboard?r=@r';">
+                        <span class="glyphicon glyphicon-retweet icon-on-right bigger-110"></span>
+                        清空
+                    </button>
+                </span>
+            </div>
+        }
     </form>
 </div>
 <table class="table table-bordered table-hover table-striped table-condensed">
     <thead>
         <tr>
-            <th class="text-center"><a href="?r=@r&sort=name">名称</a></th>
-            <th class="text-center"><a href="?r=@r&sort=size">大小</a></th>
-            <th class="text-center"><a href="?r=@r&sort=lastwrite">修改时间</a></th>
+            <th class="text-center"><a href="~/Admin/File?r=@r&sort=name">名称</a></th>
+            <th class="text-center"><a href="~/Admin/File?r=@r&sort=size">大小</a></th>
+            <th class="text-center"><a href="~/Admin/File?r=@r&sort=lastwrite">修改时间</a></th>
             <th class="text-center">复制</th>
             <th class="text-center">压缩</th>
             <th class="text-center">删除</th>
@@ -59,7 +86,16 @@
                 }
                 <td class="text-right">@item.Size</td>
                 <td class="text-center">@item.LastWrite.ToFullString("")</td>
-                <td class="text-center"><a href="~/Admin/File/Copy?r=@item.FullName" title="复制到剪切板,然后去目标目录粘贴">复制</a></td>
+                <td class="text-center">
+                    @if (!clips.Any(e => e.FullName == item.FullName))
+                    {
+                        <a href="~/Admin/File/Copy?r=@r&f=@item.FullName" title="复制到剪切板,然后去目标目录粘贴">复制</a>
+                    }
+                    else
+                    {
+                        <a href="~/Admin/File/CancelCopy?r=@r&f=@item.FullName" title="从剪切板移除">取消复制</a>
+                    }
+                </td>
                 @if (item.Name.EndsWithIgnoreCase(".zip"))
                 {
                     <td class="text-center"><a href="~/Admin/File/Decompress?r=@item.FullName" title="解压缩到当前目录">解压缩</a></td>
Modified +299 -82
diff --git a/NewLife.Cube/Areas/Admin/Views/File/Index.generated.cs b/NewLife.Cube/Areas/Admin/Views/File/Index.generated.cs
index f15f89c..ea5d8c9 100644
--- a/NewLife.Cube/Areas/Admin/Views/File/Index.generated.cs
+++ b/NewLife.Cube/Areas/Admin/Views/File/Index.generated.cs
@@ -66,6 +66,7 @@ namespace ASP
     //ViewBag.Title = "服务器信息";
     var fs = Model as List<FileItem>;
     var r = ViewBag.Current as String;
+    var clips = ViewBag.Clip as ICollection<FileItem>;
 
             
             #line default
@@ -76,9 +77,9 @@ WriteLiteral(" class=\"form-inline\"");
 
 WriteLiteral(">\r\n    <form");
 
-WriteAttribute("action", Tuple.Create(" action=\"", 234), Tuple.Create("\"", 255)
-, Tuple.Create(Tuple.Create("", 243), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File")
-, 243), false)
+WriteAttribute("action", Tuple.Create(" action=\"", 290), Tuple.Create("\"", 311)
+, Tuple.Create(Tuple.Create("", 299), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File")
+, 299), false)
 );
 
 WriteLiteral(" id=\"tool\"");
@@ -105,14 +106,14 @@ WriteLiteral(" type=\"search\"");
 
 WriteLiteral(" id=\"r\"");
 
-WriteAttribute("value", Tuple.Create(" value=\"", 487), Tuple.Create("\"", 497)
+WriteAttribute("value", Tuple.Create(" value=\"", 543), Tuple.Create("\"", 553)
             
-            #line 15 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 495), Tuple.Create<System.Object, System.Int32>(r
+            #line 16 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 551), Tuple.Create<System.Object, System.Int32>(r
             
             #line default
             #line hidden
-, 495), false)
+, 551), false)
 );
 
 WriteLiteral(" class=\"form-control\"");
@@ -127,13 +128,13 @@ WriteLiteral(">\r\n                <button");
 
 WriteLiteral(" type=\"submit\"");
 
-WriteLiteral(" class=\"btn btn-purple btn-sm\"");
+WriteLiteral(" class=\"btn btn-primary btn-sm\"");
 
 WriteLiteral(">\r\n                    <span");
 
 WriteLiteral(" class=\"glyphicon glyphicon-folder-open icon-on-right bigger-110\"");
 
-WriteLiteral("></span>\r\n                    跳转\r\n                </button>\r\n            </span>\r" +
+WriteLiteral("></span>\r\n                    打开\r\n                </button>\r\n            </span>\r" +
 "\n        </div>\r\n        <div");
 
 WriteLiteral(" class=\"input-group\"");
@@ -164,7 +165,7 @@ WriteLiteral(">\r\n                <button");
 
 WriteLiteral(" type=\"submit\"");
 
-WriteLiteral(" class=\"btn btn-purple btn-sm\"");
+WriteLiteral(" class=\"btn btn-success btn-sm\"");
 
 WriteLiteral(" onclick=\"$(\'#tool\').attr(\'action\', \'/Admin/File/Upload\');$(\'#tool\').attr(\'enctyp" +
 "e\', \'multipart/form-data\'); return true;\"");
@@ -174,7 +175,152 @@ WriteLiteral(">\r\n                    <span");
 WriteLiteral(" class=\"glyphicon glyphicon-plus icon-on-right bigger-110\"");
 
 WriteLiteral("></span>\r\n                    上传\r\n                </button>\r\n            </span>\r" +
-"\n        </div>\r\n    </form>\r\n</div>\r\n<table");
+"\n        </div>\r\n");
+
+            
+            #line 36 "..\..\Areas\Admin\Views\File\Index.cshtml"
+        
+            
+            #line default
+            #line hidden
+            
+            #line 36 "..\..\Areas\Admin\Views\File\Index.cshtml"
+         if (clips.Count > 0)
+        {
+
+            
+            #line default
+            #line hidden
+WriteLiteral("            <div");
+
+WriteLiteral(" class=\"input-group\"");
+
+WriteLiteral(">\r\n                <span");
+
+WriteLiteral(" class=\"input-group-addon\"");
+
+WriteLiteral(">\r\n                    <i");
+
+WriteLiteral(" class=\"glyphicon glyphicon-floppy-disk\"");
+
+WriteAttribute("title", Tuple.Create(" title=\"", 1749), Tuple.Create("\"", 1777)
+, Tuple.Create(Tuple.Create("", 1757), Tuple.Create("剪切板共有", 1757), true)
+            
+            #line 40 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create(" ", 1762), Tuple.Create<System.Object, System.Int32>(clips.Count
+            
+            #line default
+            #line hidden
+, 1763), false)
+, Tuple.Create(Tuple.Create(" ", 1775), Tuple.Create("项", 1776), true)
+);
+
+WriteLiteral(">");
+
+            
+            #line 40 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                                                                                       Write(clips.Count);
+
+            
+            #line default
+            #line hidden
+WriteLiteral("</i>\r\n                </span>\r\n                <span");
+
+WriteLiteral(" class=\"input-group-btn\"");
+
+WriteLiteral(">\r\n                    <button");
+
+WriteLiteral(" type=\"button\"");
+
+WriteLiteral(" class=\"btn btn-pink btn-sm\"");
+
+WriteAttribute("onclick", Tuple.Create(" onclick=\"", 1939), Tuple.Create("\"", 1990)
+, Tuple.Create(Tuple.Create("", 1949), Tuple.Create("location.href", 1949), true)
+, Tuple.Create(Tuple.Create(" ", 1962), Tuple.Create("=", 1963), true)
+, Tuple.Create(Tuple.Create(" ", 1964), Tuple.Create("\'/Admin/File/Paste?r=", 1965), true)
+            
+            #line 43 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                                    , Tuple.Create(Tuple.Create("", 1986), Tuple.Create<System.Object, System.Int32>(r
+            
+            #line default
+            #line hidden
+, 1986), false)
+, Tuple.Create(Tuple.Create("", 1988), Tuple.Create("\';", 1988), true)
+);
+
+WriteLiteral(">\r\n                        <span");
+
+WriteLiteral(" class=\"glyphicon glyphicon-floppy-save icon-on-right bigger-110\"");
+
+WriteLiteral("></span>\r\n                        粘贴\r\n                    </button>\r\n            " +
+"    </span>\r\n                <span");
+
+WriteLiteral(" class=\"input-group-btn\"");
+
+WriteLiteral(">\r\n                    <button");
+
+WriteLiteral(" type=\"button\"");
+
+WriteLiteral(" class=\"btn btn-gray btn-sm\"");
+
+WriteAttribute("onclick", Tuple.Create(" onclick=\"", 2299), Tuple.Create("\"", 2349)
+, Tuple.Create(Tuple.Create("", 2309), Tuple.Create("location.href", 2309), true)
+, Tuple.Create(Tuple.Create(" ", 2322), Tuple.Create("=", 2323), true)
+, Tuple.Create(Tuple.Create(" ", 2324), Tuple.Create("\'/Admin/File/Move?r=", 2325), true)
+            
+            #line 49 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                                   , Tuple.Create(Tuple.Create("", 2345), Tuple.Create<System.Object, System.Int32>(r
+            
+            #line default
+            #line hidden
+, 2345), false)
+, Tuple.Create(Tuple.Create("", 2347), Tuple.Create("\';", 2347), true)
+);
+
+WriteLiteral(">\r\n                        <span");
+
+WriteLiteral(" class=\"glyphicon glyphicon-floppy-save icon-on-right bigger-110\"");
+
+WriteLiteral("></span>\r\n                        移动\r\n                    </button>\r\n            " +
+"    </span>\r\n                <span");
+
+WriteLiteral(" class=\"input-group-btn\"");
+
+WriteLiteral(">\r\n                    <button");
+
+WriteLiteral(" type=\"button\"");
+
+WriteLiteral(" class=\"btn btn-yellow btn-sm\"");
+
+WriteAttribute("onclick", Tuple.Create(" onclick=\"", 2660), Tuple.Create("\"", 2720)
+, Tuple.Create(Tuple.Create("", 2670), Tuple.Create("location.href", 2670), true)
+, Tuple.Create(Tuple.Create(" ", 2683), Tuple.Create("=", 2684), true)
+, Tuple.Create(Tuple.Create(" ", 2685), Tuple.Create("\'/Admin/File/ClearClipboard?r=", 2686), true)
+            
+            #line 55 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                                               , Tuple.Create(Tuple.Create("", 2716), Tuple.Create<System.Object, System.Int32>(r
+            
+            #line default
+            #line hidden
+, 2716), false)
+, Tuple.Create(Tuple.Create("", 2718), Tuple.Create("\';", 2718), true)
+);
+
+WriteLiteral(">\r\n                        <span");
+
+WriteLiteral(" class=\"glyphicon glyphicon-retweet icon-on-right bigger-110\"");
+
+WriteLiteral("></span>\r\n                        清空\r\n                    </button>\r\n            " +
+"    </span>\r\n            </div>\r\n");
+
+            
+            #line 61 "..\..\Areas\Admin\Views\File\Index.cshtml"
+        }
+
+            
+            #line default
+            #line hidden
+WriteLiteral("    </form>\r\n</div>\r\n<table");
 
 WriteLiteral(" class=\"table table-bordered table-hover table-striped table-condensed\"");
 
@@ -184,16 +330,17 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 1664), Tuple.Create("\"", 1686)
-, Tuple.Create(Tuple.Create("", 1671), Tuple.Create("?r=", 1671), true)
+WriteAttribute("href", Tuple.Create(" href=\"", 3105), Tuple.Create("\"", 3139)
+, Tuple.Create(Tuple.Create("", 3112), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File?r=")
+, 3112), false)
             
-            #line 40 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 1674), Tuple.Create<System.Object, System.Int32>(r
+            #line 67 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 3127), Tuple.Create<System.Object, System.Int32>(r
             
             #line default
             #line hidden
-, 1674), false)
-, Tuple.Create(Tuple.Create("", 1676), Tuple.Create("&sort=name", 1676), true)
+, 3127), false)
+, Tuple.Create(Tuple.Create("", 3129), Tuple.Create("&sort=name", 3129), true)
 );
 
 WriteLiteral(">名称</a></th>\r\n            <th");
@@ -202,16 +349,17 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 1739), Tuple.Create("\"", 1761)
-, Tuple.Create(Tuple.Create("", 1746), Tuple.Create("?r=", 1746), true)
+WriteAttribute("href", Tuple.Create(" href=\"", 3192), Tuple.Create("\"", 3226)
+, Tuple.Create(Tuple.Create("", 3199), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File?r=")
+, 3199), false)
             
-            #line 41 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 1749), Tuple.Create<System.Object, System.Int32>(r
+            #line 68 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 3214), Tuple.Create<System.Object, System.Int32>(r
             
             #line default
             #line hidden
-, 1749), false)
-, Tuple.Create(Tuple.Create("", 1751), Tuple.Create("&sort=size", 1751), true)
+, 3214), false)
+, Tuple.Create(Tuple.Create("", 3216), Tuple.Create("&sort=size", 3216), true)
 );
 
 WriteLiteral(">大小</a></th>\r\n            <th");
@@ -220,16 +368,17 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 1814), Tuple.Create("\"", 1841)
-, Tuple.Create(Tuple.Create("", 1821), Tuple.Create("?r=", 1821), true)
+WriteAttribute("href", Tuple.Create(" href=\"", 3279), Tuple.Create("\"", 3318)
+, Tuple.Create(Tuple.Create("", 3286), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File?r=")
+, 3286), false)
             
-            #line 42 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 1824), Tuple.Create<System.Object, System.Int32>(r
+            #line 69 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 3301), Tuple.Create<System.Object, System.Int32>(r
             
             #line default
             #line hidden
-, 1824), false)
-, Tuple.Create(Tuple.Create("", 1826), Tuple.Create("&sort=lastwrite", 1826), true)
+, 3301), false)
+, Tuple.Create(Tuple.Create("", 3303), Tuple.Create("&sort=lastwrite", 3303), true)
 );
 
 WriteLiteral(">修改时间</a></th>\r\n            <th");
@@ -247,13 +396,13 @@ WriteLiteral(" class=\"text-center\"");
 WriteLiteral(">删除</th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n");
 
             
-            #line 49 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 76 "..\..\Areas\Admin\Views\File\Index.cshtml"
         
             
             #line default
             #line hidden
             
-            #line 49 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 76 "..\..\Areas\Admin\Views\File\Index.cshtml"
          foreach (var item in fs)
         {
 
@@ -263,13 +412,13 @@ WriteLiteral(">删除</th>\r\n        </tr>\r\n    </thead>\r\n    <tbody>\r\n")
 WriteLiteral("            <tr>\r\n");
 
             
-            #line 52 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 79 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 
             
             #line default
             #line hidden
             
-            #line 52 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 79 "..\..\Areas\Admin\Views\File\Index.cshtml"
                  if (item.Directory)
                 {
 
@@ -278,16 +427,16 @@ WriteLiteral("            <tr>\r\n");
             #line hidden
 WriteLiteral("                    <td>&nbsp;&nbsp;<a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 2194), Tuple.Create("\"", 2230)
-, Tuple.Create(Tuple.Create("", 2201), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File?r=")
-, 2201), false)
+WriteAttribute("href", Tuple.Create(" href=\"", 3671), Tuple.Create("\"", 3707)
+, Tuple.Create(Tuple.Create("", 3678), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File?r=")
+, 3678), false)
             
-            #line 54 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 2216), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line 81 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 3693), Tuple.Create<System.Object, System.Int32>(item.FullName
             
             #line default
             #line hidden
-, 2216), false)
+, 3693), false)
 );
 
 WriteLiteral(" title=\"进入目录\"");
@@ -295,7 +444,7 @@ WriteLiteral(" title=\"进入目录\"");
 WriteLiteral(">");
 
             
-            #line 54 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 81 "..\..\Areas\Admin\Views\File\Index.cshtml"
                                                                                     Write(item.Name);
 
             
@@ -304,7 +453,7 @@ WriteLiteral(">");
 WriteLiteral("</a></td>\r\n");
 
             
-            #line 55 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 82 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 }
                 else
                 {
@@ -314,16 +463,16 @@ WriteLiteral("</a></td>\r\n");
             #line hidden
 WriteLiteral("                    <td>&nbsp;&nbsp;<a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 2364), Tuple.Create("\"", 2409)
-, Tuple.Create(Tuple.Create("", 2371), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Download?r=")
-, 2371), false)
+WriteAttribute("href", Tuple.Create(" href=\"", 3841), Tuple.Create("\"", 3886)
+, Tuple.Create(Tuple.Create("", 3848), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Download?r=")
+, 3848), false)
             
-            #line 58 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 2395), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line 85 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 3872), Tuple.Create<System.Object, System.Int32>(item.FullName
             
             #line default
             #line hidden
-, 2395), false)
+, 3872), false)
 );
 
 WriteLiteral(" title=\"下载文件\"");
@@ -331,7 +480,7 @@ WriteLiteral(" title=\"下载文件\"");
 WriteLiteral(">");
 
             
-            #line 58 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 85 "..\..\Areas\Admin\Views\File\Index.cshtml"
                                                                                              Write(item.Name);
 
             
@@ -340,7 +489,7 @@ WriteLiteral(">");
 WriteLiteral("</a></td>\r\n");
 
             
-            #line 59 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 86 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 }
 
             
@@ -353,7 +502,7 @@ WriteLiteral(" class=\"text-right\"");
 WriteLiteral(">");
 
             
-            #line 60 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 87 "..\..\Areas\Admin\Views\File\Index.cshtml"
                                   Write(item.Size);
 
             
@@ -366,7 +515,7 @@ WriteLiteral(" class=\"text-center\"");
 WriteLiteral(">");
 
             
-            #line 61 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 88 "..\..\Areas\Admin\Views\File\Index.cshtml"
                                    Write(item.LastWrite.ToFullString(""));
 
             
@@ -376,32 +525,100 @@ WriteLiteral("</td>\r\n                <td");
 
 WriteLiteral(" class=\"text-center\"");
 
-WriteLiteral("><a");
+WriteLiteral(">\r\n");
+
+            
+            #line 90 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                    
+            
+            #line default
+            #line hidden
+            
+            #line 90 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                     if (!clips.Any(e => e.FullName == item.FullName))
+                    {
 
-WriteAttribute("href", Tuple.Create(" href=\"", 2641), Tuple.Create("\"", 2682)
-, Tuple.Create(Tuple.Create("", 2648), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Copy?r=")
-, 2648), false)
             
-            #line 62 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 2668), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line default
+            #line hidden
+WriteLiteral("                        <a");
+
+WriteAttribute("href", Tuple.Create(" href=\"", 4239), Tuple.Create("\"", 4285)
+, Tuple.Create(Tuple.Create("", 4246), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Copy?r=")
+, 4246), false)
+            
+            #line 92 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4266), Tuple.Create<System.Object, System.Int32>(r
             
             #line default
             #line hidden
-, 2668), false)
+, 4266), false)
+, Tuple.Create(Tuple.Create("", 4268), Tuple.Create("&f=", 4268), true)
+            
+            #line 92 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4271), Tuple.Create<System.Object, System.Int32>(item.FullName
+            
+            #line default
+            #line hidden
+, 4271), false)
 );
 
 WriteLiteral(" title=\"复制到剪切板,然后去目标目录粘贴\"");
 
-WriteLiteral(">复制</a></td>\r\n");
+WriteLiteral(">复制</a>\r\n");
 
             
-            #line 63 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 93 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                    }
+                    else
+                    {
+
+            
+            #line default
+            #line hidden
+WriteLiteral("                        <a");
+
+WriteAttribute("href", Tuple.Create(" href=\"", 4418), Tuple.Create("\"", 4470)
+, Tuple.Create(Tuple.Create("", 4425), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/CancelCopy?r=")
+, 4425), false)
+            
+            #line 96 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4451), Tuple.Create<System.Object, System.Int32>(r
+            
+            #line default
+            #line hidden
+, 4451), false)
+, Tuple.Create(Tuple.Create("", 4453), Tuple.Create("&f=", 4453), true)
+            
+            #line 96 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4456), Tuple.Create<System.Object, System.Int32>(item.FullName
+            
+            #line default
+            #line hidden
+, 4456), false)
+);
+
+WriteLiteral(" title=\"从剪切板移除\"");
+
+WriteLiteral(">取消复制</a>\r\n");
+
+            
+            #line 97 "..\..\Areas\Admin\Views\File\Index.cshtml"
+                    }
+
+            
+            #line default
+            #line hidden
+WriteLiteral("                </td>\r\n");
+
+            
+            #line 99 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 
             
             #line default
             #line hidden
             
-            #line 63 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 99 "..\..\Areas\Admin\Views\File\Index.cshtml"
                  if (item.Name.EndsWithIgnoreCase(".zip"))
                 {
 
@@ -414,16 +631,16 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 2847), Tuple.Create("\"", 2894)
-, Tuple.Create(Tuple.Create("", 2854), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Decompress?r=")
-, 2854), false)
+WriteAttribute("href", Tuple.Create(" href=\"", 4668), Tuple.Create("\"", 4715)
+, Tuple.Create(Tuple.Create("", 4675), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Decompress?r=")
+, 4675), false)
             
-            #line 65 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 2880), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line 101 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4701), Tuple.Create<System.Object, System.Int32>(item.FullName
             
             #line default
             #line hidden
-, 2880), false)
+, 4701), false)
 );
 
 WriteLiteral(" title=\"解压缩到当前目录\"");
@@ -431,7 +648,7 @@ WriteLiteral(" title=\"解压缩到当前目录\"");
 WriteLiteral(">解压缩</a></td>\r\n");
 
             
-            #line 66 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 102 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 }
                 else
                 {
@@ -445,16 +662,16 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 3033), Tuple.Create("\"", 3078)
-, Tuple.Create(Tuple.Create("", 3040), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Compress?r=")
-, 3040), false)
+WriteAttribute("href", Tuple.Create(" href=\"", 4854), Tuple.Create("\"", 4899)
+, Tuple.Create(Tuple.Create("", 4861), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Compress?r=")
+, 4861), false)
             
-            #line 69 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 3064), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line 105 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 4885), Tuple.Create<System.Object, System.Int32>(item.FullName
             
             #line default
             #line hidden
-, 3064), false)
+, 4885), false)
 );
 
 WriteLiteral(" title=\"压缩到当前目录,加上时间后缀\"");
@@ -462,7 +679,7 @@ WriteLiteral(" title=\"压缩到当前目录,加上时间后缀\"");
 WriteLiteral(">压缩</a></td>\r\n");
 
             
-            #line 70 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 106 "..\..\Areas\Admin\Views\File\Index.cshtml"
                 }
 
             
@@ -474,16 +691,16 @@ WriteLiteral(" class=\"text-center\"");
 
 WriteLiteral("><a");
 
-WriteAttribute("href", Tuple.Create(" href=\"", 3177), Tuple.Create("\"", 3220)
-, Tuple.Create(Tuple.Create("", 3184), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Delete?r=")
-, 3184), false)
+WriteAttribute("href", Tuple.Create(" href=\"", 4998), Tuple.Create("\"", 5041)
+, Tuple.Create(Tuple.Create("", 5005), Tuple.Create<System.Object, System.Int32>(Href("~/Admin/File/Delete?r=")
+, 5005), false)
             
-            #line 71 "..\..\Areas\Admin\Views\File\Index.cshtml"
-, Tuple.Create(Tuple.Create("", 3206), Tuple.Create<System.Object, System.Int32>(item.FullName
+            #line 107 "..\..\Areas\Admin\Views\File\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 5027), Tuple.Create<System.Object, System.Int32>(item.FullName
             
             #line default
             #line hidden
-, 3206), false)
+, 5027), false)
 );
 
 WriteLiteral(" onclick=\"return confirm(\'确认删除?\');\"");
@@ -491,7 +708,7 @@ WriteLiteral(" onclick=\"return confirm(\'确认删除?\');\"");
 WriteLiteral(">删除</a></td>\r\n            </tr>\r\n");
 
             
-            #line 73 "..\..\Areas\Admin\Views\File\Index.cshtml"
+            #line 109 "..\..\Areas\Admin\Views\File\Index.cshtml"
         }