From bb2fbfaafa86a2d935850e619d01896e6b41091f Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Wed, 2 Sep 2020 13:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=88=9B=E5=BB=BA=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E6=A8=A1=E5=BC=8F=E6=89=AB=E6=8F=8F=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E9=80=89=E6=8B=A9=E6=96=87=E4=BB=B6=E5=A4=B9=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Netch/Forms/Mode/Process.cs | 15 ++++++++++++--- Netch/Netch.csproj | 1 + Netch/PostBuild.bat | 7 +++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Netch/Forms/Mode/Process.cs b/Netch/Forms/Mode/Process.cs index 662c7461..e946cfa9 100644 --- a/Netch/Forms/Mode/Process.cs +++ b/Netch/Forms/Mode/Process.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Microsoft.WindowsAPICodePack.Dialogs; using Netch.Utils; namespace Netch.Forms.Mode @@ -171,10 +172,18 @@ namespace Netch.Forms.Mode private void ScanButton_Click(object sender, EventArgs e) { - var dialog = new FolderBrowserDialog(); - if (dialog.ShowDialog(this) == DialogResult.OK) + var dialog = new CommonOpenFileDialog { - ScanDirectory(dialog.SelectedPath); + IsFolderPicker = true, + Multiselect = false, + Title = i18N.Translate("Select a folder"), + AddToMostRecentlyUsedList = false, + EnsurePathExists = true, + NavigateToShortcut = true + }; + if (dialog.ShowDialog(Win32Native.GetForegroundWindow()) == CommonFileDialogResult.Ok) + { + ScanDirectory(dialog.FileName); MessageBoxX.Show(i18N.Translate("Scan completed")); } } diff --git a/Netch/Netch.csproj b/Netch/Netch.csproj index 7cb386e7..6acda02c 100644 --- a/Netch/Netch.csproj +++ b/Netch/Netch.csproj @@ -64,6 +64,7 @@ + diff --git a/Netch/PostBuild.bat b/Netch/PostBuild.bat index 0b4554b0..d97aaa87 100644 --- a/Netch/PostBuild.bat +++ b/Netch/PostBuild.bat @@ -9,10 +9,17 @@ if %Configuration%==Release ( %TargetDir%MaxMind.GeoIP2.dll ^ %TargetDir%Microsoft.Diagnostics.FastSerialization.dll ^ %TargetDir%Microsoft.Diagnostics.Tracing.TraceEvent.dll ^ +%TargetDir%Microsoft.WindowsAPICodePack.dll ^ +%TargetDir%Microsoft.WindowsAPICodePack.Shell.dll ^ %TargetDir%NetchLib.dll ^ %TargetDir%Newtonsoft.Json.dll ^ %TargetDir%OSExtensions.dll ^ +%TargetDir%System.Buffers.dll ^ +%TargetDir%System.Collections.Immutable.dll ^ +%TargetDir%System.Memory.dll ^ %TargetDir%System.Net.IPNetwork.dll ^ +%TargetDir%System.Numerics.Vectors.dll ^ +%TargetDir%System.Reflection.Metadata.dll ^ %TargetDir%System.Runtime.CompilerServices.Unsafe.dll ^ %TargetDir%TraceReloggerLib.dll