From a077d2082e8fa1bb15028c83bc2def19e3535cd6 Mon Sep 17 00:00:00 2001 From: muqing <1966944300@qq.com> Date: Tue, 24 Sep 2024 15:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ModeSwitch.cs | 1 + Program.cs | 6 ++---- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- SearchFile.cs | 5 +---- 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/ModeSwitch.cs b/ModeSwitch.cs index e8663d8..75df4fb 100644 --- a/ModeSwitch.cs +++ b/ModeSwitch.cs @@ -28,6 +28,7 @@ public class ModeSwitch var key = Console.ReadKey(true); Console.SetCursorPosition(CalculateActualLength($"{mode}.{str[mode]}") + 1, mode + 1); Console.Write(' '); + // Console.Write(key.Key); if (key.Key >= ConsoleKey.D0 && key.Key <= ConsoleKey.D9) { int v1 = int.Parse(key.KeyChar.ToString()); diff --git a/Program.cs b/Program.cs index d482fc8..3bbfd84 100644 --- a/Program.cs +++ b/Program.cs @@ -1,6 +1,7 @@  using System.Diagnostics; +using System.Net; using System.Runtime.InteropServices; using System.Text; using Debug.ModelingMusic; @@ -54,10 +55,7 @@ public class Program public Program() { - // MinLong.Main.ResetChars(); - // _ = new MinLong.Main(); - // return; - string[] str = ["退出", "抽卡", "搜索引擎", "音乐调试", "小龙快跑"]; + string[] str = ["退出", "抽卡", "搜索引擎", "下落字符", "小龙快跑"]; var modeSwitch = new ModeSwitch("请选择你要执行的操作:", str, (a) => { switch (a) diff --git a/README.md b/README.md index 5382b06..7394b40 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,54 @@ # ModelingMusic -基于WindowsForm的程序 +### 一款C#的控制台程序 +## 功能 +1. 抽卡模拟器 +2. 文件/文件夹搜索 +3. 下落字符调试 +4. 小龙快跑 简易游戏 + +## 集成和使用 + 内置选择模式 + 可自由添加模块 + PgUp/W 上选择 + PgDn/S 下选择 + Enter(回车) 确定执行 + +### 方法 + var 变量 = new ModeSwitch("string", string[], (a) => + { + //在这里处理选择逻辑 + }); + +### 例子 + string[] str = ["退出", "模块", "模块", "模块", "模块"]; + var modeSwitch = new ModeSwitch("请选择你要执行的操作:", str, (a) => + { + switch (a) + { + case 0: + //需要执行的方法模块 + break; + case 1: + //需要执行的方法模块 + break; + case 2: + //需要执行的方法模块 + break; + case 3: + //需要执行的方法模块 + break; + case 4: + //需要执行的方法模块 + break; + default: + printfLine("还没有这个功能"); + break; + } + }); +### 输出 + 请选择你要执行的操作: + 0.退出 > + 1.模块 + 2.模块 + 3.模块 + 4.模块 \ No newline at end of file diff --git a/SearchFile.cs b/SearchFile.cs index b6ea546..2e68645 100644 --- a/SearchFile.cs +++ b/SearchFile.cs @@ -29,7 +29,7 @@ public class Mod "ramboplayGame", "QQ", "QQWORD","Microsoft SDKs","Creator","editors","AndroidSDK","SDK","Pr","PR","PS","Ps","WE", "androidstudioword","xshell7" ]; - private readonly bool isExcludeFile = false; + private readonly bool isExcludeFile = true; public string FileDir = string.Empty; public Mod() { @@ -79,7 +79,6 @@ public class Mod if (d.IsReady == true) { var name = d.Name; - // if (name.Contains("C:\\"))//排除系统盘 // { // continue; @@ -96,8 +95,6 @@ public class Mod { try { - // Console.WriteLine("正在搜索:" + path); - DirectoryInfo dirInfo = new(path); foreach (var directory in dirInfo.EnumerateDirectories()) {