Parcourir la source

添加项目文件。

向羽 孟 il y a 8 mois
Parent
commit
48fdfd1d58

+ 22 - 0
BaiduYunBeiFen.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35521.163 d17.12
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaiduYunBeiFen", "BaiduYunBeiFen\BaiduYunBeiFen.csproj", "{7A1CC4DD-61C3-409D-85DF-FF0DB49BD1E3}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7A1CC4DD-61C3-409D-85DF-FF0DB49BD1E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7A1CC4DD-61C3-409D-85DF-FF0DB49BD1E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7A1CC4DD-61C3-409D-85DF-FF0DB49BD1E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7A1CC4DD-61C3-409D-85DF-FF0DB49BD1E3}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 14 - 0
BaiduYunBeiFen/BaiduYunBeiFen.csproj

@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="RequestModel\" />
+  </ItemGroup>
+
+</Project>

+ 6 - 0
BaiduYunBeiFen/Program.cs

@@ -0,0 +1,6 @@
+// See https://aka.ms/new-console-template for more information
+using BaiduYunBeiFen;
+using System.Diagnostics;
+
+PybyClass pybyClass = new PybyClass();
+pybyClass.CheckPathFile("/c bypy ls LuBo/377943_栗枯Likuu/23_11_07");

+ 57 - 0
BaiduYunBeiFen/PybyClass.cs

@@ -0,0 +1,57 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BaiduYunBeiFen
+{
+    public class PybyClass
+    {
+        public List<string> CheckPathFile(string YunPath)
+        {
+            List<string> Result = new List<string>();
+            string OutYunPath;
+            ProcessStartInfo processStartInfo = new ProcessStartInfo();
+            processStartInfo.FileName = "cmd.exe";
+            processStartInfo.Arguments = YunPath;
+            processStartInfo.RedirectStandardOutput = true;
+            processStartInfo.UseShellExecute = false;
+            processStartInfo.CreateNoWindow = true;
+            // 创建并启动Process对象
+            Process process = new Process();
+            process.StartInfo = processStartInfo;
+            process.Start();
+            // 读取CMD输出
+            string output = process.StandardOutput.ReadToEnd();
+            process.WaitForExit();
+            process.Dispose();
+            string[] Message = output.Split(Environment.NewLine);
+            Result = ReMoveWarnMessage(Message.ToList(),out OutYunPath);
+            return Result;
+        }
+        public List<string> ReMoveWarnMessage(List<string> FileList,out string YunPath)
+        {
+            List<string> Result = new List<string>(FileList);
+            List<string> WarnList = new List<string>()
+            {
+                "<W>",
+                "Files with non-ASCII names may not be handled correctly.",
+                "You should set your System Locale to 'UTF-8'.",
+                "Current locale is 'cp65001'"
+            };
+            foreach (string File in FileList)
+            {
+                if (WarnList.Exists(t => File.Contains(t)))
+                {
+                    Result.Remove(File);
+                }
+            }
+            YunPath = Result[0];
+            Result.Remove(Result[0]);
+            return Result;
+        }
+    }
+}