Skip to content

Commit 5db5168

Browse files
各种细节优化
1 parent 3d490d9 commit 5db5168

11 files changed

Lines changed: 49 additions & 107 deletions

File tree

MFAScreenLock/ImageControl/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
// 有关程序集的一般信息由以下
66
// 控制。更改这些特性值可修改
77
// 与程序集关联的信息。
8-
[assembly: AssemblyTitle("雅诗动态密码锁定工具")]
8+
[assembly: AssemblyTitle("NyarukoMFALock")]
99
[assembly: AssemblyDescription("图片处理工具")]
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("神楽坂雅詩")]
1212
[assembly: AssemblyProduct("设备锁定器4")]
13-
[assembly: AssemblyCopyright("Copyright © 2021")]
14-
[assembly: AssemblyTrademark("https://github.com/kagurazakayashi/MFAScreenLock/blob/master/LICENSE")]
13+
[assembly: AssemblyCopyright("https://github.com/kagurazakayashi/MFAScreenLock/blob/master/LICENSE")]
14+
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

1717
// 将 ComVisible 设置为 false 会使此程序集中的类型
@@ -32,5 +32,5 @@
3232
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
3333
//通过使用 "*",如下所示:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.3.0.0")]
36-
[assembly: AssemblyFileVersion("4.3.0.0")]
35+
[assembly: AssemblyVersion("4.5.0.0")]
36+
[assembly: AssemblyFileVersion("4.5.0.0")]

MFAScreenLock/MFAScreenLockApp/About.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MFAScreenLock/MFAScreenLockApp/About.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,21 @@ private void About_Load(object sender, EventArgs e)
6262
formLockSubList.Add("系统内存: " + Environment.SystemPageSize.ToString());
6363
formLockSubList.Add("启动模式: " + SystemInformation.BootMode.ToString());
6464
formLockSubList.Add("系统目录: " + Environment.SystemDirectory);
65-
formLockSubList.Add("主显示器分辨率: " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Height.ToString() + " (当前 " + SystemInformation.PrimaryMonitorSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorSize.Height.ToString() + " )");
65+
formLockSubList.Add("主显示器分辨率: " + SystemInformation.PrimaryMonitorSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorSize.Height.ToString() + " (可用区域 " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Height.ToString() + " )");
6666
formLockSubList.Add("显示器 ( " + SystemInformation.MonitorCount.ToString() + " ):");
6767
Screen[] screens = Screen.AllScreens;
6868
uint screenI = 1;
6969
foreach (Screen screen in screens)
7070
{
7171
Rectangle area = screen.WorkingArea;
72+
Rectangle bound = screen.Bounds;
7273
FormLockSub locksub = new FormLockSub();
7374
string primary = "";
7475
if (screen.Primary)
7576
{
7677
primary = "(主显示器)";
7778
}
78-
formLockSubList.Add("显示器 " + (screenI++).ToString() + " " + primary + ": 位置 " + area.Top.ToString() + " , " + area.Left.ToString() + " 区域 " + area.Size.Width + " x " + area.Size.Height);
79+
formLockSubList.Add("显示器 " + (screenI++).ToString() + " " + primary + ": 位置 " + bound.Top.ToString() + " , " + bound.Left.ToString() + " 区域位置 " + area.Top.ToString() + " , " + area.Left.ToString() + " 分辨率 " + bound.Size.Width.ToString() + " x " + bound.Size.Height.ToString() + " 区域 " + area.Size.Width.ToString() + " x " + area.Size.Height.ToString());
7980
}
8081
foreach (string line in formLockSubList)
8182
{

MFAScreenLock/MFAScreenLockApp/Form1.cs

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public Form1()
2727

2828
private void Form1_Load(object sender, EventArgs e)
2929
{
30-
this.BeginInvoke(new Action(() => {
30+
BeginInvoke(new Action(() => {
3131
Hide();
3232
}));
3333
版本ToolStripMenuItem.Text = "版本:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
34-
string programname = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
35-
System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(programname);//获取指定的进程名
34+
string programname = Process.GetCurrentProcess().ProcessName;
35+
Process[] myProcesses = Process.GetProcessesByName(programname);//获取指定的进程名
3636
wallPaperBmp = ShareClass.gWallPaperBmp();
3737
args = Environment.GetCommandLineArgs();
3838
if (loadConfig() && myProcesses.Length > 1) //如果可以获取到知道的进程名则说明已经启动
@@ -55,30 +55,37 @@ private bool loadConfig()
5555
if (result == DialogResult.Yes)
5656
{
5757
Settings.Default.Reset();
58+
Restart();
59+
return false;
5860
}
59-
notifyIcon1.Visible = false;
60-
Application.Exit();
6161
}
6262
if (Settings.Default.MachineName == "")
6363
{
6464
timer_lock.Enabled = false;
6565
FormUser formuser = new FormUser();
66-
formuser.ShowDialog();
67-
if (formuser.ws == 1)
66+
formuser.ws = 0;
67+
bool bindMode = false;
68+
if (Settings.Default.MachineName.Length == 0)
6869
{
69-
notifyIcon1.Visible = false;
70-
Application.Exit();
70+
bindMode = true;
7171
}
72-
else
72+
formuser.ShowDialog();
73+
if (!(bindMode && Settings.Default.MachineName.Length > 0))
7374
{
74-
if (args.Length > 1 && args[1] == "-e")
75+
if (formuser.ws == 1)
7576
{
7677
notifyIcon1.Visible = false;
7778
Application.Exit();
7879
}
79-
this.BeginInvoke(new Action(() => {
80+
else
81+
{
82+
if (args.Length > 1 && args[1] == "-e")
83+
{
84+
notifyIcon1.Visible = false;
85+
Application.Exit();
86+
}
8087
Close();
81-
}));
88+
}
8289
}
8390
formuser.ws = 0;
8491
timer_lock.Enabled = true;
@@ -135,14 +142,15 @@ private void lockallscreen(bool islock = true, Bitmap wallPaperBmp = null)
135142
continue;
136143
}
137144
Rectangle area = screen.WorkingArea;
145+
Rectangle bound = screen.Bounds;
138146
FormLockSub locksub = new FormLockSub();
139147
locksub.Top = area.Top;
140148
locksub.Left = area.Left;
141149
locksub.Show();
142150
locksub.WindowState = FormWindowState.Maximized;
143151
if (!screen.Primary)
144152
{
145-
locksub.setBackgroundImage(wallPaperBmp, area.Size);
153+
locksub.setBackgroundImage(wallPaperBmp, bound.Size);
146154
}
147155
formLockSubList.Add(locksub);
148156
}

MFAScreenLock/MFAScreenLockApp/FormLock.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void setBackgroundImage(Bitmap newWallPaperBmp)
6262

6363
private void FormLock_Load(object sender, EventArgs e)
6464
{
65-
if (Settings.Default.AccountSecretKey == "")
65+
if (!previewMode && Settings.Default.AccountSecretKey == "")
6666
{
6767
ws = 1;
6868
aClose();
@@ -345,6 +345,7 @@ private void timer_err_Tick(object sender, EventArgs e)
345345
btn_enter.Text = "→";
346346
timer_err.Enabled = false;
347347
pwdEnableNow = 0;
348+
txt_pwdcode.Focus();
348349
}
349350
else
350351
{

MFAScreenLock/MFAScreenLockApp/FormUser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private void showPreview()
222222
formlock.lbl_info.Text = formlock.Text;
223223
formlock.setBackgroundImage(ShareClass.gWallPaperBmp());
224224
formlock.previewMode = true;
225-
formlock.FormBorderStyle = FormBorderStyle.Fixed3D;
225+
//formlock.FormBorderStyle = FormBorderStyle.Fixed3D;
226226
formlock.ControlBox = true;
227227
formlock.MaximizeBox = true;
228228
formlock.TopMost = false;

MFAScreenLock/MFAScreenLockApp/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

MFAScreenLock/MFAScreenLockApp/MFAScreenLockApp.csproj

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
<MapFileExtensions>true</MapFileExtensions>
2828
<SupportUrl>https://github.com/kagurazakayashi/MFAScreenLock</SupportUrl>
2929
<ErrorReportUrl>https://github.com/kagurazakayashi/MFAScreenLock/issues</ErrorReportUrl>
30-
<TargetCulture>zh</TargetCulture>
31-
<ProductName>雅诗动态密码锁定工具</ProductName>
32-
<PublisherName>北京篝火网络科技有限公司</PublisherName>
33-
<SuiteName>霄霄设备锁定器4</SuiteName>
34-
<ApplicationRevision>1</ApplicationRevision>
35-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
30+
<TargetCulture>zh-Hans</TargetCulture>
31+
<ProductName>NyarukoMFALock</ProductName>
32+
<PublisherName>神楽坂雅詩</PublisherName>
33+
<SuiteName>设备锁定器4</SuiteName>
34+
<ApplicationRevision>5</ApplicationRevision>
35+
<ApplicationVersion>4.5.0.%2a</ApplicationVersion>
3636
<UseApplicationTrust>false</UseApplicationTrust>
3737
<CreateDesktopShortcut>true</CreateDesktopShortcut>
3838
<PublishWizardCompleted>true</PublishWizardCompleted>
@@ -71,7 +71,7 @@
7171
<ManifestKeyFile>MFAScreenLockApp_TemporaryKey.pfx</ManifestKeyFile>
7272
</PropertyGroup>
7373
<PropertyGroup>
74-
<GenerateManifests>false</GenerateManifests>
74+
<GenerateManifests>true</GenerateManifests>
7575
</PropertyGroup>
7676
<PropertyGroup>
7777
<TargetZone>LocalIntranet</TargetZone>
@@ -186,9 +186,6 @@
186186
<DesignTime>True</DesignTime>
187187
</Compile>
188188
<None Include="app.config" />
189-
<None Include="LICENSE">
190-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
191-
</None>
192189
<None Include="MFAScreenLockApp_TemporaryKey.pfx" />
193190
<None Include="packages.config" />
194191
<None Include="Properties\app.manifest" />
@@ -203,9 +200,6 @@
203200
</Compile>
204201
</ItemGroup>
205202
<ItemGroup>
206-
<None Include="README.md">
207-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
208-
</None>
209203
<None Include="Resources\ic_lock_2x.png" />
210204
</ItemGroup>
211205
<ItemGroup>

MFAScreenLock/MFAScreenLockApp/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// 有关程序集的一般信息由以下
77
// 控制。更改这些特性值可修改
88
// 与程序集关联的信息。
9-
[assembly: AssemblyTitle("雅诗动态密码锁定工具")]
10-
[assembly: AssemblyDescription("使用谷歌验证器锁定电脑")]
9+
[assembly: AssemblyTitle("NyarukoMFALock")]
10+
[assembly: AssemblyDescription("雅诗动态密码锁定工具:使用谷歌验证器锁定电脑")]
1111
[assembly: AssemblyConfiguration("")]
1212
[assembly: AssemblyCompany("神楽坂雅詩")]
1313
[assembly: AssemblyProduct("设备锁定器4")]

MFAScreenLock/MFAScreenLockApp/README.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)