Skip to content

Commit

Permalink
实现白名单磁盘复制 & 重写设置保存机制,支持保存到USBCopyerData目录 & 支持高DPI缩放
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvix committed Jun 22, 2018
1 parent d6b5686 commit 0d94b0f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 54 deletions.
Binary file modified .vs/USBCopyer/v15/.suo
Binary file not shown.
24 changes: 18 additions & 6 deletions USBCopyer/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,27 @@ protected override void DefWndProc(ref Message m)
}
if (EnableToolStripMenuItem.Checked)
{
if (!string.IsNullOrEmpty(diskser) && blackid.Contains(diskser))
//使用黑名单磁盘模式
if(Properties.Settings.Default.UseBlackDisk)
{
Program.log("黑名单磁盘序列号:" + diskser + " 取消复制!");
return;
if (!string.IsNullOrEmpty(diskser) && blackid.Contains(diskser))
{
Program.log("黑名单磁盘序列号:" + diskser + " 取消复制!");
return;
}
if (!string.IsNullOrEmpty(disk) && blackdisk.Contains(disk.Substring(0, 1)))
{
Program.log("黑名单分区号:" + disk + " 取消复制!");
return;
}
}
if (blackdisk.Contains(disk.Substring(0, 1)))
else //使用白名单磁盘模式
{
Program.log("黑名单分区号:" + disk + " 取消复制!");
return;
if ((string.IsNullOrEmpty(diskser) || !blackid.Contains(diskser)) && (string.IsNullOrEmpty(disk) || !blackdisk.Contains(disk.Substring(0, 1))))
{
Program.log("磁盘序列号:" + diskser + " 及分区号 " + disk + " 均不在白名单,取消复制!");
return;
}
}
copyThread[disk] = new Thread(() =>
{
Expand Down
8 changes: 3 additions & 5 deletions USBCopyer/Properties/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />

<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
Expand All @@ -48,13 +48,11 @@
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->

<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<dependency>
Expand Down
Loading

0 comments on commit 0d94b0f

Please sign in to comment.