登录用户超时注销、登录日志记录
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace JinYuan.Helper
|
||||
{
|
||||
public class InputMessageFilter : IMessageFilter
|
||||
{
|
||||
private Action onActivity;
|
||||
|
||||
public InputMessageFilter(Action onActivity)
|
||||
{
|
||||
this.onActivity = onActivity;
|
||||
}
|
||||
|
||||
public bool PreFilterMessage(ref Message m)
|
||||
{
|
||||
// 鼠标移动(0x0200)、鼠标按下(0x0201)、键盘按下(0x0100)等
|
||||
if (m.Msg == 0x0200 || m.Msg == 0x0201 || m.Msg == 0x0204
|
||||
|
||||
|| m.Msg == 0x0100 || m.Msg == 0x0101)
|
||||
{
|
||||
onActivity?.Invoke();
|
||||
}
|
||||
return false; // 不拦截消息,继续传递
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,6 +140,7 @@
|
||||
<Compile Include="FileHelper.cs" />
|
||||
<Compile Include="IniConfigHelper.cs" />
|
||||
<Compile Include="IniFileHelper.cs" />
|
||||
<Compile Include="InputMessageFilter.cs" />
|
||||
<Compile Include="JsonHelper.cs" />
|
||||
<Compile Include="Logger.cs" />
|
||||
<Compile Include="MockDataGenerator.cs" />
|
||||
|
||||
Reference in New Issue
Block a user