diff options
| author | SmallFox <2806143047@qq.com> | 2026-04-08 15:02:49 +0800 |
|---|---|---|
| committer | SmallFox <2806143047@qq.com> | 2026-04-08 15:02:49 +0800 |
| commit | a4f2ef9fc0d3d5b941a982b265c68faad682f2d5 (patch) | |
| tree | 5d4e44fd638c31efc30f0ad605fcd5de4030c9a3 | |
| parent | 2eb16b22f8bb9e08fc690be09ab92b29f4911d3d (diff) | |
| parent | 00c5ce748b56c672d2f4e796d3f0b263200f95f8 (diff) | |
| -rw-r--r-- | NotePad/NotePad/Program.cs | 5 | ||||
| -rwxr-xr-x | lin_build.sh | 29 | ||||
| -rwxr-xr-x | lin_run.sh | 12 |
3 files changed, 43 insertions, 3 deletions
diff --git a/NotePad/NotePad/Program.cs b/NotePad/NotePad/Program.cs index c1e3d1e..0f5f1bb 100644 --- a/NotePad/NotePad/Program.cs +++ b/NotePad/NotePad/Program.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using System.Windows.Forms; namespace NotePad @@ -14,7 +11,9 @@ namespace NotePad [STAThread] static void Main() { +#if NETFRAMEWORK || NETCOREAPP Application.SetHighDpiMode(HighDpiMode.SystemAware); +#endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new NotePad()); diff --git a/lin_build.sh b/lin_build.sh new file mode 100755 index 0000000..f8f0b21 --- /dev/null +++ b/lin_build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# 检查 Mono 编译器是否存在 +if ! command -v mcs &> /dev/null; then + echo "ERROR: mcs command not found. Please install Mono." + exit 1 +fi + +cd "$(dirname "$0")/NotePad/NotePad/" + +mkdir -p bin/Linux + +# 使用 Mono 编译 +mcs \ + -target:winexe \ + -out:bin/Linux/NotePad.exe \ + -r:System.Windows.Forms \ + -r:System.Drawing \ + -r:System \ + -r:System.Data \ + -r:System.Xml \ + Form1.cs Form1.Designer.cs Program.cs + +if [ $? -eq 0 ]; then + echo "SUCCESS" +else + echo "FAILED" + exit 1 +fi diff --git a/lin_run.sh b/lin_run.sh new file mode 100755 index 0000000..148fd06 --- /dev/null +++ b/lin_run.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# 检查 Wine 是否存在 +if ! command -v wine &> /dev/null; then + echo "ERROR: wine command not found. Please install Wine." + exit 1 +fi + +cd "$(dirname "$0")/NotePad/NotePad/" + +# 使用 Wine 运行 NotePad.exe +wine ./bin/Linux/NotePad.exe |
