From 884abf5b0e323472e3ef3f7d2074dc669285c617 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Sat, 7 Feb 2026 10:43:25 +0800 Subject: [PATCH] =?UTF-8?q?add:Dlass=E9=81=A5=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +++++- Ink Canvas/App.xaml.cs | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c4df8dfc..5cec64f6 100644 --- a/.gitignore +++ b/.gitignore @@ -425,4 +425,8 @@ FodyWeavers.xsd *.msi *.msix *.msm -*.msp \ No newline at end of file +*.msp + +# Telemetry DSN configuration file (contains sensitive information) +telemetry_dsn.txt +**/telemetry_dsn.txt \ No newline at end of file diff --git a/Ink Canvas/App.xaml.cs b/Ink Canvas/App.xaml.cs index 31d1d9ec..e3bcb218 100644 --- a/Ink Canvas/App.xaml.cs +++ b/Ink Canvas/App.xaml.cs @@ -1269,7 +1269,30 @@ namespace Ink_Canvas return envDsn; } - return "https://9aa07b78ee2a43edae34cc6c116ce90a@iccce.dlass.tech/2"; + string assemblyLocation = Assembly.GetExecutingAssembly().Location; + string currentDir = Path.GetDirectoryName(assemblyLocation); + + for (int i = 0; i < 5; i++) + { + string dsnFilePath = Path.Combine(currentDir, "telemetry_dsn.txt"); + if (File.Exists(dsnFilePath)) + { + string dsn = File.ReadAllText(dsnFilePath, System.Text.Encoding.UTF8).Trim(); + if (!string.IsNullOrWhiteSpace(dsn)) + { + return dsn; + } + } + + DirectoryInfo parentDir = Directory.GetParent(currentDir); + if (parentDir == null) + { + break; + } + currentDir = parentDir.FullName; + } + + return string.Empty; } catch {