ModelingDebug/Program.cs

107 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using Debug.ModelingMusic;
namespace Debug;
/// <summary>
/// 主程序入口 参考 https://blog.csdn.net/oscar999/article/details/141370223
/// 在VS Code的终端中使用dotnet build命令来编译项目。这将在项目目录中生成一个bin文件夹其中包含编译后的程序集。
/// 使用dotnet run命令来运行项目。这将编译项目如果尚未编译并运行编译后的程序。
/// </summary>
public class Program
{
public static void printf(object a)
{
Console.Write(a);
}
public static void printfLine(object a)
{
Console.WriteLine(a);
}
[DllImport("kernel32.dll")]
private static extern bool SetConsoleTitle(string title);
//开始计时
public static void Main(string[] args)
{
// 设置控制台标题为一个独特的字符串
SetConsoleTitle("Tools");
// 设置控制台输出编码,以支持复杂字符
Console.OutputEncoding = Encoding.UTF8;
//// 主循环
//while (true)
//{
// // 创建一个缓冲区
// char[,] buffer = new char[height, width];
// // 在缓冲区中绘制内容
// for (int y = 0; y < height; y++)
// {
// for (int x = 0; x < width; x++)
// {
// buffer[y, x] = (x + y) % 2 == 0 ? '#' : ' ';
// }
// }
// // 将缓冲区的内容输出到控制台
// Console.SetCursorPosition(0, 0);
// Console.Clear();
// StringBuilder sb = new StringBuilder();
// for (int y = 0; y < height; y++)
// {
// for (int x = 0; x < width; x++)
// {
// sb.Append(buffer[y, x]);
// }
// sb.AppendLine();
// }
// Console.Write(sb.ToString());
// // 控制刷新率
// Thread.Sleep(200);
//}
_ = new Program();
}
public static bool IsWhile = true;
public Program()
{
// new Thread(MusicDebug.MusicRhythm).Start();
// return;
// new Debug.MinLong.KongLong();
// return;
do
{
printfLine("请选择你要执行的操作:"); printf(" 0.退出 ");
printf(" 1.抽拉 "); printf(" 2.铁锈位置搜索引擎 ");
Console.WriteLine();
var v = Console.ReadLine();
if (int.TryParse(v, out var i))
{
switch (i)
{
case 0:
Environment.Exit(0);
break;
case 1:
_ = new ChouKa();
break;
case 2:
_ = new Mod();
break;
case 3:
_ = new Music();
return;
default:
printfLine("还没有这个功能");
break;
}
}
} while (true);
}
}