跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

AppInfo.cs

57 行 · 1.6 KB历史下载
1using Core.Enums;
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Security.AccessControl;
6using System.Text;
7using System.Threading.Tasks;
8
9namespace Core.Models.AppObserver
10{
11 /// <summary>
12 /// 应用信息
13 /// </summary>
14 public class AppInfo
15 {
16 /// <summary>
17 /// 进程ID
18 /// </summary>
19 public int PID { get; }
20 /// <summary>
21 /// 应用类型
22 /// </summary>
23 public AppType Type { get; }
24 /// <summary>
25 /// 进程名称
26 /// </summary>
27 public string Process { get; }
28 /// <summary>
29 /// 应用描述
30 /// </summary>
31 public string Description { get; }
32 /// <summary>
33 /// 可执行文件路径
34 /// </summary>
35 public string ExecutablePath { get; }
36 /// <summary>
37 /// 窗口句柄
38 /// </summary>
39 public IntPtr WindowHandle { get; }
40 public AppInfo(IntPtr windowHandle_, int pid_, string process_, string description_, string executablePath_, AppType type_ = AppType.Win32)
41 {
42 WindowHandle = windowHandle_;
43 PID = pid_;
44 Process = process_;
45 Description = description_;
46 ExecutablePath = executablePath_;
47 Type = type_;
48 }
49
50 public override string ToString()
51 {
52 return $"WindowHandle:{WindowHandle},PID:{PID},ProcessName:{Process},Description:{Description},ExecutablePath:{ExecutablePath},Type:{Type}";
53 }
54
55 public static AppInfo Empty = new AppInfo(IntPtr.Zero, 0, string.Empty, string.Empty, string.Empty);
56 }
57}