Skip to content

Commit

Permalink
各种细节优化
Browse files Browse the repository at this point in the history
  • Loading branch information
kagurazakayashi committed Mar 9, 2021
1 parent 3d490d9 commit 5db5168
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 107 deletions.
10 changes: 5 additions & 5 deletions MFAScreenLock/ImageControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("雅诗动态密码锁定工具")]
[assembly: AssemblyTitle("NyarukoMFALock")]
[assembly: AssemblyDescription("图片处理工具")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("神楽坂雅詩")]
[assembly: AssemblyProduct("设备锁定器4")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("https://github.com/kagurazakayashi/MFAScreenLock/blob/master/LICENSE")]
[assembly: AssemblyCopyright("https://github.com/kagurazakayashi/MFAScreenLock/blob/master/LICENSE")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
Expand All @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.3.0.0")]
[assembly: AssemblyFileVersion("4.3.0.0")]
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("4.5.0.0")]
8 changes: 4 additions & 4 deletions MFAScreenLock/MFAScreenLockApp/About.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions MFAScreenLock/MFAScreenLockApp/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,21 @@ private void About_Load(object sender, EventArgs e)
formLockSubList.Add("系统内存: " + Environment.SystemPageSize.ToString());
formLockSubList.Add("启动模式: " + SystemInformation.BootMode.ToString());
formLockSubList.Add("系统目录: " + Environment.SystemDirectory);
formLockSubList.Add("主显示器分辨率: " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Height.ToString() + " (当前 " + SystemInformation.PrimaryMonitorSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorSize.Height.ToString() + " )");
formLockSubList.Add("主显示器分辨率: " + SystemInformation.PrimaryMonitorSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorSize.Height.ToString() + " (可用区域 " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Width.ToString() + " x " + SystemInformation.PrimaryMonitorMaximizedWindowSize.Height.ToString() + " )");
formLockSubList.Add("显示器 ( " + SystemInformation.MonitorCount.ToString() + " ):");
Screen[] screens = Screen.AllScreens;
uint screenI = 1;
foreach (Screen screen in screens)
{
Rectangle area = screen.WorkingArea;
Rectangle bound = screen.Bounds;
FormLockSub locksub = new FormLockSub();
string primary = "";
if (screen.Primary)
{
primary = "(主显示器)";
}
formLockSubList.Add("显示器 " + (screenI++).ToString() + " " + primary + ": 位置 " + area.Top.ToString() + " , " + area.Left.ToString() + " 区域 " + area.Size.Width + " x " + area.Size.Height);
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());
}
foreach (string line in formLockSubList)
{
Expand Down
36 changes: 22 additions & 14 deletions MFAScreenLock/MFAScreenLockApp/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public Form1()

private void Form1_Load(object sender, EventArgs e)
{
this.BeginInvoke(new Action(() => {
BeginInvoke(new Action(() => {
Hide();
}));
版本ToolStripMenuItem.Text = "版本:" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
string programname = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(programname);//获取指定的进程名
string programname = Process.GetCurrentProcess().ProcessName;
Process[] myProcesses = Process.GetProcessesByName(programname);//获取指定的进程名
wallPaperBmp = ShareClass.gWallPaperBmp();
args = Environment.GetCommandLineArgs();
if (loadConfig() && myProcesses.Length > 1) //如果可以获取到知道的进程名则说明已经启动
Expand All @@ -55,30 +55,37 @@ private bool loadConfig()
if (result == DialogResult.Yes)
{
Settings.Default.Reset();
Restart();
return false;
}
notifyIcon1.Visible = false;
Application.Exit();
}
if (Settings.Default.MachineName == "")
{
timer_lock.Enabled = false;
FormUser formuser = new FormUser();
formuser.ShowDialog();
if (formuser.ws == 1)
formuser.ws = 0;
bool bindMode = false;
if (Settings.Default.MachineName.Length == 0)
{
notifyIcon1.Visible = false;
Application.Exit();
bindMode = true;
}
else
formuser.ShowDialog();
if (!(bindMode && Settings.Default.MachineName.Length > 0))
{
if (args.Length > 1 && args[1] == "-e")
if (formuser.ws == 1)
{
notifyIcon1.Visible = false;
Application.Exit();
}
this.BeginInvoke(new Action(() => {
else
{
if (args.Length > 1 && args[1] == "-e")
{
notifyIcon1.Visible = false;
Application.Exit();
}
Close();
}));
}
}
formuser.ws = 0;
timer_lock.Enabled = true;
Expand Down Expand Up @@ -135,14 +142,15 @@ private void lockallscreen(bool islock = true, Bitmap wallPaperBmp = null)
continue;
}
Rectangle area = screen.WorkingArea;
Rectangle bound = screen.Bounds;
FormLockSub locksub = new FormLockSub();
locksub.Top = area.Top;
locksub.Left = area.Left;
locksub.Show();
locksub.WindowState = FormWindowState.Maximized;
if (!screen.Primary)
{
locksub.setBackgroundImage(wallPaperBmp, area.Size);
locksub.setBackgroundImage(wallPaperBmp, bound.Size);
}
formLockSubList.Add(locksub);
}
Expand Down
3 changes: 2 additions & 1 deletion MFAScreenLock/MFAScreenLockApp/FormLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void setBackgroundImage(Bitmap newWallPaperBmp)

private void FormLock_Load(object sender, EventArgs e)
{
if (Settings.Default.AccountSecretKey == "")
if (!previewMode && Settings.Default.AccountSecretKey == "")
{
ws = 1;
aClose();
Expand Down Expand Up @@ -345,6 +345,7 @@ private void timer_err_Tick(object sender, EventArgs e)
btn_enter.Text = "→";
timer_err.Enabled = false;
pwdEnableNow = 0;
txt_pwdcode.Focus();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion MFAScreenLock/MFAScreenLockApp/FormUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private void showPreview()
formlock.lbl_info.Text = formlock.Text;
formlock.setBackgroundImage(ShareClass.gWallPaperBmp());
formlock.previewMode = true;
formlock.FormBorderStyle = FormBorderStyle.Fixed3D;
//formlock.FormBorderStyle = FormBorderStyle.Fixed3D;
formlock.ControlBox = true;
formlock.MaximizeBox = true;
formlock.TopMost = false;
Expand Down
21 changes: 0 additions & 21 deletions MFAScreenLock/MFAScreenLockApp/LICENSE

This file was deleted.

20 changes: 7 additions & 13 deletions MFAScreenLock/MFAScreenLockApp/MFAScreenLockApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<MapFileExtensions>true</MapFileExtensions>
<SupportUrl>https://github.com/kagurazakayashi/MFAScreenLock</SupportUrl>
<ErrorReportUrl>https://github.com/kagurazakayashi/MFAScreenLock/issues</ErrorReportUrl>
<TargetCulture>zh</TargetCulture>
<ProductName>雅诗动态密码锁定工具</ProductName>
<PublisherName>北京篝火网络科技有限公司</PublisherName>
<SuiteName>霄霄设备锁定器4</SuiteName>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<TargetCulture>zh-Hans</TargetCulture>
<ProductName>NyarukoMFALock</ProductName>
<PublisherName>神楽坂雅詩</PublisherName>
<SuiteName>设备锁定器4</SuiteName>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>4.5.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -71,7 +71,7 @@
<ManifestKeyFile>MFAScreenLockApp_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
Expand Down Expand Up @@ -186,9 +186,6 @@
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="LICENSE">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="MFAScreenLockApp_TemporaryKey.pfx" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
Expand All @@ -203,9 +200,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\ic_lock_2x.png" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions MFAScreenLock/MFAScreenLockApp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("雅诗动态密码锁定工具")]
[assembly: AssemblyDescription("使用谷歌验证器锁定电脑")]
[assembly: AssemblyTitle("NyarukoMFALock")]
[assembly: AssemblyDescription("雅诗动态密码锁定工具:使用谷歌验证器锁定电脑")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("神楽坂雅詩")]
[assembly: AssemblyProduct("设备锁定器4")]
Expand Down
41 changes: 0 additions & 41 deletions MFAScreenLock/MFAScreenLockApp/README.md

This file was deleted.

6 changes: 3 additions & 3 deletions MFAScreenLock/SysLink/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("雅诗动态密码锁定工具")]
[assembly: AssemblyTitle("NyarukoMFALock")]
[assembly: AssemblyDescription("系统库连接工具")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("神楽坂雅詩")]
Expand All @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.3.0.0")]
[assembly: AssemblyFileVersion("4.3.0.0")]
[assembly: AssemblyVersion("4.5.0.0")]
[assembly: AssemblyFileVersion("4.5.0.0")]

0 comments on commit 5db5168

Please sign in to comment.