From ae85166efafeba93ff3c1b887f02567a9bb3c4c1 Mon Sep 17 00:00:00 2001 From: zmjack Date: Fri, 10 Mar 2023 04:08:15 +0800 Subject: [PATCH] PortProxyGUI.1.4.0 --- PortProxyGUI/Data/ApplicationDbScope.cs | 3 +-- PortProxyGUI/PortProxyGUI.csproj | 2 +- PortProxyGUI/Program.cs | 8 +++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/PortProxyGUI/Data/ApplicationDbScope.cs b/PortProxyGUI/Data/ApplicationDbScope.cs index 99c8a0a..782abeb 100644 --- a/PortProxyGUI/Data/ApplicationDbScope.cs +++ b/PortProxyGUI/Data/ApplicationDbScope.cs @@ -15,10 +15,9 @@ namespace PortProxyGUI.Data public static ApplicationDbScope FromFile(string file) { var dir = Path.GetDirectoryName(file); - var fileName = Path.GetFileName(file); if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); - if (!File.Exists(fileName)) + if (!File.Exists(file)) { #if NETCOREAPP3_0_OR_GREATER #else diff --git a/PortProxyGUI/PortProxyGUI.csproj b/PortProxyGUI/PortProxyGUI.csproj index 915d212..9f69eb0 100644 --- a/PortProxyGUI/PortProxyGUI.csproj +++ b/PortProxyGUI/PortProxyGUI.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows;netcoreapp3.1;net35;net451 + net6.0-windows;net35;net451 true app.manifest zmjack diff --git a/PortProxyGUI/Program.cs b/PortProxyGUI/Program.cs index 7fa50be..a92bcbb 100644 --- a/PortProxyGUI/Program.cs +++ b/PortProxyGUI/Program.cs @@ -9,7 +9,13 @@ namespace PortProxyGUI { static class Program { - public static readonly ApplicationDbScope Database = ApplicationDbScope.FromFile(ApplicationDbScope.AppDbFile); + public static readonly ApplicationDbScope Database = ApplicationDbScope.FromFile( + Path.Combine( + Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), + "PortProxyGUI" + ), "config.db" + )); /// /// The main entry point for the application.