diff --git a/Apewer.Run/FileRenamer.cs b/Apewer.Run/FileRenamer.cs
new file mode 100644
index 0000000..af87ce6
--- /dev/null
+++ b/Apewer.Run/FileRenamer.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Apewer.Run
+{
+
+ class FileRenamer
+ {
+
+ public FileRenamer()
+ {
+ // RenameZQSV();
+
+ var paths = StorageUtility.GetSubFiles(@"Y:\telecast\芸汐传", true);
+ foreach (var path in paths)
+ {
+ var name = Path.GetFileName(path);
+
+ // name = name.Replace(" ", "");
+ name = name.Replace(".qsv.flv.mp4", ".mp4");
+ name = name.Replace(".qsv.flv.mp4", "");
+ name = name.Replace("【4K】", "");
+
+ var split = name.Split(' ');
+ split[1] = split[1].Replace("第", "").Replace("集", "");
+ if (split[1].Length == 1) split[1] = "0" + split[1];
+ split[1] = "第 " + split[1] + " 集";
+
+ name = string.Join(" - ", split) + ".mp4";
+
+ var newPath = Path.Combine(Path.GetDirectoryName(path), name);
+ if (newPath != path)
+ {
+ File.Move(path, newPath);
+ Console.WriteLine($"{path} -> {newPath}");
+ }
+ // else Console.WriteLine(path);
+ }
+ }
+
+ void RenameZQSV()
+ {
+ var paths = Apewer.StorageUtility.GetSubFiles("z:\\", true);
+ foreach (var path in paths)
+ {
+ RenameFile(path, " ", "_");
+ RenameFile(path, "【蓝光1080P】", "");
+ }
+ }
+
+ void RenameFile(string path, string oldSub, string newSub)
+ {
+ if (path.Contains(oldSub))
+ {
+ var newName = path.Replace(oldSub, newSub);
+ File.Move(path, newName);
+ Console.WriteLine($"{path} -> {newName}");
+ }
+ else
+ {
+ Console.WriteLine(path);
+ }
+ }
+
+ }
+
+}
diff --git a/Apewer.Run/HashComputer.cs b/Apewer.Run/HashComputer.cs
new file mode 100644
index 0000000..73c2e7d
--- /dev/null
+++ b/Apewer.Run/HashComputer.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Apewer.Run
+{
+
+ class HashComputer
+ {
+
+ public HashComputer()
+ {
+ var path = @"Y:\telecast\新白娘子传奇";
+ var subs = StorageUtility.GetSubFiles(path, true);
+ subs.Sort();
+ var array = Json.NewArray();
+ foreach (var sub in subs)
+ {
+ var md5 = "";
+ using (var file = StorageUtility.OpenFile(sub))
+ {
+ var info = new FileInfo(sub);
+ var length = info.Length;
+ md5 = BinaryUtility.MD5(file, (p) =>
+ {
+ Console.WriteLine($"{sub} total={length} progress={p}");
+ }).ToX2();
+ }
+
+ Console.WriteLine($"{sub} md5={md5}");
+
+ var item = Json.NewObject();
+ item["path"] = sub;
+ item["md5"] = md5;
+ array.AddItem(item);
+ }
+
+ StorageUtility.WriteFile(path + ".json", array.ToString(true).ToBinary());
+ }
+
+ }
+
+}
diff --git a/Apewer.Run/_Program.cs b/Apewer.Run/_Program.cs
index 86e3f3c..d7f348a 100644
--- a/Apewer.Run/_Program.cs
+++ b/Apewer.Run/_Program.cs
@@ -1,6 +1,7 @@
using Apewer;
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Reflection;
namespace Apewer.Run
@@ -17,6 +18,9 @@ namespace Apewer.Run
// RunPublicClass(args);
+ // new FileRenamer();
+ // new HashComputer();
+
Console.WriteLine("ended");
Console.ReadKey();
}
diff --git a/Apewer/Apewer.csproj b/Apewer/Apewer.csproj
index 9bedd6f..3ab6c77 100644
--- a/Apewer/Apewer.csproj
+++ b/Apewer/Apewer.csproj
@@ -7,7 +7,7 @@
Apewer
Apewer
Apewer
- 6.0.8
+ 6.0.9
diff --git a/Apewer/Network/SslUtility.cs b/Apewer/Network/SslUtility.cs
index c76c9ce..d9b7947 100644
--- a/Apewer/Network/SslUtility.cs
+++ b/Apewer/Network/SslUtility.cs
@@ -19,7 +19,7 @@ namespace Apewer.Network
set { ServicePointManager.ServerCertificateValidationCallback = value; }
}
- /// 证书验证。
+ /// 证书验证。忽略所有错误。
public static bool ApproveAll(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
@@ -39,7 +39,7 @@ namespace Apewer.Network
return null;
}
- /// 证书验证。
+ /// 证书验证。要求必须有正确的证书。
public static bool ApproveRight(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return (errors == SslPolicyErrors.None) ? true : false;
diff --git a/Apewer/TextUtility.cs b/Apewer/TextUtility.cs
index a73a6c9..f871f7e 100644
--- a/Apewer/TextUtility.cs
+++ b/Apewer/TextUtility.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
+using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
@@ -20,22 +21,13 @@ namespace Apewer
public const string EmptyString = Constant.EmptyString;
/// 合并为字符串。
- public static string Merge(params object[] cells)
- {
- return Join(null, cells);
- }
+ public static string Merge(params object[] cells) => Join(null, cells);
/// 合并为字符串。
- public static string Merge(IEnumerable