UserLoginWindow.cs
878 字节
using System;
using System.Windows.Forms;
namespace SmartScan
{
public static class UserLoginWindow
{
public static bool Show()
{
if (BLL.Config.Backgrounder) //后台模式不需要登录
return true;
if (Common.config.EnabledUserLogin)
{
FrmUsersLogin frm = new();
if (frm.ShowDialog() == DialogResult.OK)
{
return true;
}
else
{
Model.LogNet.log.Info("=====退出登录=====");
return false;
}
}
else
{
Common.config.UserName = "None user";
Common.config.UserLevel = Model.UserLevel.Admin;
return true;
}
}
}
}