();
78 | dic.Add(1, "成功");
79 | dic.Add(0, "失败");
80 |
81 |
82 | #line default
83 | #line hidden
84 | WriteLiteral("\r\n\r\n \r\n");
95 |
96 | WriteLiteral(" ");
97 |
98 |
99 | #line 16 "..\..\Areas\WiFi\Views\DeviceHistory\_List_Search.cshtml"
100 | Write(Html.ForDropDownList("action", DeviceHistory.FindAllActionName(), Request["action"], "全部", true));
101 |
102 |
103 | #line default
104 | #line hidden
105 | WriteLiteral("\r\n
\r\n\r\n \r\n");
116 |
117 | WriteLiteral(" ");
118 |
119 |
120 | #line 20 "..\..\Areas\WiFi\Views\DeviceHistory\_List_Search.cshtml"
121 | Write(Html.ForDropDownList("success", dic, Request["success"], "全部", true));
122 |
123 |
124 | #line default
125 | #line hidden
126 | WriteLiteral("\r\n
\r\n");
127 |
128 | }
129 | }
130 | }
131 | #pragma warning restore 1591
132 |
--------------------------------------------------------------------------------
/WiFi.Web/Areas/WiFi/Views/DeviceOnline/_List_Search.cshtml:
--------------------------------------------------------------------------------
1 | @using NewLife;
2 | @using NewLife.Web;
3 | @using NewLife.Cube;
4 | @using XCode;
5 | @using WiFi.Entity;
6 | @{
7 | var fact = ViewBag.Factory as IEntityOperate;
8 | var page = ViewBag.Page as Pager;
9 | }
10 |
11 |
12 | @Html.ForDropDownList("Kind", System.EnumHelper.GetDescriptions(typeof(DeviceKinds)), Request["Kind"], "全部", true)
13 |
14 |
--------------------------------------------------------------------------------
/WiFi.Web/Areas/WiFi/Views/DeviceOnline/_List_Search.generated.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable 1591
2 | //------------------------------------------------------------------------------
3 | //
4 | // 此代码由工具生成。
5 | // 运行时版本:4.0.30319.42000
6 | //
7 | // 对此文件的更改可能会导致不正确的行为,并且如果
8 | // 重新生成代码,这些更改将会丢失。
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | namespace ASP
13 | {
14 | using System;
15 | using System.Collections.Generic;
16 | using System.IO;
17 | using System.Linq;
18 | using System.Net;
19 | using System.Text;
20 | using System.Web;
21 | using System.Web.Helpers;
22 | using System.Web.Mvc;
23 | using System.Web.Mvc.Ajax;
24 | using System.Web.Mvc.Html;
25 | using System.Web.Routing;
26 | using System.Web.Security;
27 | using System.Web.UI;
28 | using System.Web.WebPages;
29 |
30 | #line 1 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
31 | using NewLife;
32 |
33 | #line default
34 | #line hidden
35 |
36 | #line 3 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
37 | using NewLife.Cube;
38 |
39 | #line default
40 | #line hidden
41 | using NewLife.Reflection;
42 |
43 | #line 2 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
44 | using NewLife.Web;
45 |
46 | #line default
47 | #line hidden
48 |
49 | #line 5 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
50 | using WiFi.Entity;
51 |
52 | #line default
53 | #line hidden
54 |
55 | #line 4 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
56 | using XCode;
57 |
58 | #line default
59 | #line hidden
60 | using XCode.Membership;
61 |
62 | [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
63 | [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/WiFi/Views/DeviceOnline/_List_Search.cshtml")]
64 | public partial class _Areas_WiFi_Views_DeviceOnline__List_Search_cshtml : System.Web.Mvc.WebViewPage
65 | {
66 | public _Areas_WiFi_Views_DeviceOnline__List_Search_cshtml()
67 | {
68 | }
69 | public override void Execute()
70 | {
71 |
72 | #line 6 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
73 |
74 | var fact = ViewBag.Factory as IEntityOperate;
75 | var page = ViewBag.Page as Pager;
76 |
77 |
78 | #line default
79 | #line hidden
80 | WriteLiteral("\r\n\r\n \r\n");
91 |
92 | WriteLiteral(" ");
93 |
94 |
95 | #line 12 "..\..\Areas\WiFi\Views\DeviceOnline\_List_Search.cshtml"
96 | Write(Html.ForDropDownList("Kind", System.EnumHelper.GetDescriptions(typeof(DeviceKinds)), Request["Kind"], "全部", true));
97 |
98 |
99 | #line default
100 | #line hidden
101 | WriteLiteral("\r\n
\r\n");
102 |
103 | }
104 | }
105 | }
106 | #pragma warning restore 1591
107 |
--------------------------------------------------------------------------------
/WiFi.Web/Areas/WiFi/Views/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
46 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/WiFi.Web/Areas/WiFi/WiFiAreaRegistration.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using System.Web.Mvc;
3 | using NewLife.Cube;
4 |
5 | namespace WiFi.Device.Web
6 | {
7 | [DisplayName("客流管理")]
8 | public class WiFiAreaRegistration : AreaRegistrationBase
9 | {
10 | }
11 | }
--------------------------------------------------------------------------------
/WiFi.Web/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="WiFi.Web.MvcApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/WiFi.Web/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Mvc;
2 | using System.Web.Routing;
3 |
4 | namespace WiFi.Web
5 | {
6 | // 注意: 有关启用 IIS6 或 IIS7 经典模式的说明,
7 | // 请访问 http://go.microsoft.com/?LinkId=9394801
8 | public class MvcApplication : System.Web.HttpApplication
9 | {
10 | protected void Application_Start()
11 | {
12 | AreaRegistration.RegisterAllAreas();
13 |
14 | RouteConfig.RegisterRoutes(RouteTable.Routes);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/WiFi.Web/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("WiFi客流平台")]
9 | [assembly: AssemblyDescription("采集并存储用户WiFi数据")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyProduct("WiFi.Web")]
12 | [assembly: AssemblyCompany("新生命开发团队")]
13 | [assembly: AssemblyCopyright("Copyright © 新生命开发团队 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型,
19 | // 请针对该类型将 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("5185f285-2543-4ea7-b27e-2a14811c730e")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyFileVersion("1.0.2019.0806")]
36 |
37 | /*
38 | * v1.0.2019.0806 轻量版物联网平台
39 | */
40 |
--------------------------------------------------------------------------------
/WiFi.Web/Properties/PublishProfiles/Front.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | FileSystem
9 | Release
10 | Any CPU
11 |
12 | True
13 | True
14 | True
15 | False
16 | MergeAllOutputsToASingleAssembly
17 | True
18 | Front
19 | True
20 | True
21 | ..\..\Front\Web
22 | True
23 |
24 |
--------------------------------------------------------------------------------
/WiFi.Web/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/WiFi.Web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NewLifeX/XLink/9746943970069421d771d9fd356b03fd58710026/WiFi.Web/favicon.ico
--------------------------------------------------------------------------------
/WiFi.Web/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/WiFi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29102.190
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other", "Other", "{E9E982D4-367F-4305-ABDF-3B590673DADD}"
7 | ProjectSection(SolutionItems) = preProject
8 | Readme.MD = Readme.MD
9 | EndProjectSection
10 | EndProject
11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WiFi.Data", "WiFi.Data\WiFi.Data.csproj", "{7618CB05-1801-4AE3-AEA2-0F94BC6870AC}"
12 | EndProject
13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WiFi.Server", "WiFi.Server\WiFi.Server.csproj", "{654F9F56-A236-4E7F-8B93-B205693A20D9}"
14 | EndProject
15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WiFi.Web", "WiFi.Web\WiFi.Web.csproj", "{779BC3B7-BA72-4049-837D-3DDC53FBC0A9}"
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Release|Any CPU = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {7618CB05-1801-4AE3-AEA2-0F94BC6870AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {7618CB05-1801-4AE3-AEA2-0F94BC6870AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {7618CB05-1801-4AE3-AEA2-0F94BC6870AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {7618CB05-1801-4AE3-AEA2-0F94BC6870AC}.Release|Any CPU.Build.0 = Release|Any CPU
27 | {654F9F56-A236-4E7F-8B93-B205693A20D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28 | {654F9F56-A236-4E7F-8B93-B205693A20D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
29 | {654F9F56-A236-4E7F-8B93-B205693A20D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
30 | {654F9F56-A236-4E7F-8B93-B205693A20D9}.Release|Any CPU.Build.0 = Release|Any CPU
31 | {779BC3B7-BA72-4049-837D-3DDC53FBC0A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {779BC3B7-BA72-4049-837D-3DDC53FBC0A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {779BC3B7-BA72-4049-837D-3DDC53FBC0A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 | {779BC3B7-BA72-4049-837D-3DDC53FBC0A9}.Release|Any CPU.Build.0 = Release|Any CPU
35 | EndGlobalSection
36 | GlobalSection(SolutionProperties) = preSolution
37 | HideSolutionNode = FALSE
38 | EndGlobalSection
39 | GlobalSection(ExtensibilityGlobals) = postSolution
40 | SolutionGuid = {E2BACAC2-15CC-4C71-9436-1616D7607684}
41 | EndGlobalSection
42 | EndGlobal
43 |
--------------------------------------------------------------------------------
/link.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NewLifeX/XLink/9746943970069421d771d9fd356b03fd58710026/link.ico
--------------------------------------------------------------------------------
/xLink.Client/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/xLink.Client/Common/MachineInfo.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualBasic.Devices;
2 | using Microsoft.Win32;
3 | using NewLife;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Diagnostics;
7 | using System.Linq;
8 | using System.Management;
9 | using System.Threading.Tasks;
10 |
11 | namespace xLink.Client
12 | {
13 | /// 硬件助手
14 | public class MachineInfo
15 | {
16 | #region 属性
17 | /// 系统名称
18 | public String OSName { get; }
19 |
20 | /// 系统版本
21 | public String OSVersion { get; }
22 |
23 | /// 处理器序列号
24 | public String Processor { get; }
25 |
26 | /// 处理器序列号
27 | public String CpuID { get; }
28 |
29 | /// 唯一标识
30 | public String UUID { get; }
31 |
32 | /// 机器标识
33 | public String MachineGuid { get; }
34 |
35 | /// 内存总量
36 | public UInt64 Memory { get; }
37 |
38 | /// 可用内存
39 | public UInt64 AvailableMemory => new ComputerInfo().AvailablePhysicalMemory;
40 |
41 | private PerformanceCounter _cpuCounter;
42 | /// CPU占用率
43 | public Single CpuRate => _cpuCounter == null ? 0 : (_cpuCounter.NextValue() / 100);
44 | #endregion
45 |
46 | #region 构造
47 | public MachineInfo()
48 | {
49 | var ci = new ComputerInfo();
50 | OSName = ci.OSFullName + (Environment.Is64BitOperatingSystem ? " x64" : " x86");
51 | OSVersion = ci.OSVersion;
52 |
53 | Processor = GetInfo("Win32_Processor", "Name");
54 | CpuID = GetInfo("Win32_Processor", "ProcessorId");
55 | Memory = ci.TotalPhysicalMemory;
56 | //AvailableMemory = ci.AvailablePhysicalMemory;
57 |
58 | UUID = GetInfo("Win32_ComputerSystemProduct", "UUID");
59 |
60 | var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Cryptography");
61 | if (reg != null)
62 | {
63 | MachineGuid = reg.GetValue("MachineGuid") + "";
64 | }
65 |
66 | // 性能计数器的初始化非常耗时
67 | Task.Run(() =>
68 | {
69 | _cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total")
70 | {
71 | MachineName = "."
72 | };
73 | _cpuCounter.NextValue();
74 | });
75 | }
76 | #endregion
77 |
78 | #region WMI辅助
79 | /// 获取WMI信息
80 | ///
81 | ///
82 | ///
83 | public static String GetInfo(String path, String property)
84 | {
85 | // Linux Mono不支持WMI
86 | if (Runtime.Mono) return "";
87 |
88 | var bbs = new List();
89 | try
90 | {
91 | var wql = String.Format("Select {0} From {1}", property, path);
92 | var cimobject = new ManagementObjectSearcher(wql);
93 | var moc = cimobject.Get();
94 | foreach (var mo in moc)
95 | {
96 | if (mo != null &&
97 | mo.Properties != null &&
98 | mo.Properties[property] != null &&
99 | mo.Properties[property].Value != null)
100 | bbs.Add(mo.Properties[property].Value.ToString());
101 | }
102 | }
103 | catch
104 | {
105 | return "";
106 | }
107 |
108 | bbs.Sort();
109 |
110 | return bbs.Distinct().Join();
111 | }
112 | #endregion
113 | }
114 | }
--------------------------------------------------------------------------------
/xLink.Client/FrmDevice.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using System.Windows.Forms;
4 |
5 | namespace xLink.Client
6 | {
7 | public partial class FrmDevice : Form
8 | {
9 | public LinkClient Client { get; set; }
10 | public Byte[] Data { get; set; }
11 |
12 | public FrmDevice()
13 | {
14 | InitializeComponent();
15 | }
16 |
17 | private void FrmDevice_Load(Object sender, EventArgs e)
18 | {
19 | // 初始化数据区
20 | var buf = new Byte[1 + 4];
21 | buf[0] = (Byte)buf.Length;
22 |
23 | Data = buf;
24 | }
25 |
26 | private async Task Blink(Int32 idx)
27 | {
28 | var b = (Byte)(Data[idx] == 0 ? 1 : 0);
29 | //txtData.Text = Data.ToHex();
30 |
31 | //var buf = await Client.Write(null, idx, b);
32 | //if (buf != null && buf.Length > 0)
33 | //{
34 | // Data = buf;
35 | // txtData.Text = buf.ToHex();
36 | //}
37 | }
38 |
39 | private async void lbLed1_Click(Object sender, EventArgs e)
40 | {
41 | await Blink(1);
42 | }
43 |
44 | private async void lbLed2_Click(Object sender, EventArgs e)
45 | {
46 | await Blink(2);
47 | }
48 |
49 | private async void lbButton1_Click(Object sender, EventArgs e)
50 | {
51 | await Blink(3);
52 | }
53 |
54 | private async void lbButton2_Click(Object sender, EventArgs e)
55 | {
56 | await Blink(4);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/xLink.Client/FrmUser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using System.Windows.Forms;
4 | using NewLife.Log;
5 |
6 | namespace xLink.Client
7 | {
8 | public partial class FrmUser : Form
9 | {
10 | public LinkClient Client { get; set; }
11 | public Byte[] Data { get; set; }
12 |
13 | public FrmUser()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void FrmUser_Load(Object sender, EventArgs e)
19 | {
20 | // 初始化数据区
21 | var buf = new Byte[1 + 4];
22 | buf[0] = (Byte)buf.Length;
23 |
24 | Data = buf;
25 | }
26 |
27 | private async Task Blink(Int32 idx)
28 | {
29 | if (idx >= Data.Length) Data = new Byte[idx + 1];
30 | var b = (Byte)(Data[idx] == 0 ? 1 : 0);
31 | //txtData.Text = Data.ToHex();
32 |
33 | //var buf = await Client.Write(txtDevice.Text, idx, b);
34 | //if (buf != null && buf.Length > 0)
35 | //{
36 | // Data = buf;
37 | // txtData.Text = buf.ToHex();
38 | //}
39 | }
40 |
41 | private async void lbLed1_Click(Object sender, EventArgs e)
42 | {
43 | var idx = (sender as Control).Tag.ToInt();
44 | if (idx <= 0) return;
45 |
46 | try
47 | {
48 | await Blink(idx);
49 | }
50 | catch (Exception ex)
51 | {
52 | XTrace.WriteLine(ex.GetTrue().Message);
53 | }
54 | }
55 | }
56 | }
--------------------------------------------------------------------------------
/xLink.Client/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 | using NewLife.Log;
5 |
6 | namespace xLink.Client
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// 应用程序的主入口点。
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | XTrace.UseWinForm();
17 |
18 | // 降低进程优先级,避免卡死电脑
19 | Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
20 |
21 | Application.EnableVisualStyles();
22 | Application.SetCompatibleTextRenderingDefault(false);
23 | Application.Run(new FrmMain());
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/xLink.Client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("菲凡物联客户端")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("xLink.Client")]
13 | [assembly: AssemblyCopyright("Copyright © 新生命团队 2019")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("9b82e70b-389d-4328-a5e2-be2837072c38")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
33 | // 方法是按如下所示使用“*”: :
34 | [assembly: AssemblyVersion("3.0.*")]
35 | [assembly: AssemblyFileVersion("3.0.2019.0916")]
36 |
37 | /*
38 | * v3.0.2019.0714 抽象客户端服务端架构
39 | *
40 | * v2.0.2018.1215 升级新版通信框架
41 | *
42 | * v1.0.2017.0316 轻量版物联网平台
43 | */
44 |
--------------------------------------------------------------------------------
/xLink.Client/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace xLink.Client.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("xLink.Client.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 重写当前线程的 CurrentUICulture 属性
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/xLink.Client/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.42000
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace xLink.Client.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/xLink.Client/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/xLink.Client/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | true
49 |
50 |
51 |
52 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/xLink.Client/Services/DeviceClient.cs:
--------------------------------------------------------------------------------
1 | using NewLife;
2 | using NewLife.Net;
3 | using NewLife.Threading;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.IO.Ports;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 |
10 | namespace xLink.Client.Services
11 | {
12 | /// 设备客户端
13 | public class DeviceClient : LinkClient
14 | {
15 | #region 属性
16 | #endregion
17 |
18 | #region 构造
19 | /// 实例化
20 | ///
21 | public DeviceClient(String uri) : base(uri) { }
22 | #endregion
23 |
24 | #region 打开
25 | public override Boolean Open()
26 | {
27 | Task.Run(() => _hardInfo = new MachineInfo());
28 |
29 | return base.Open();
30 | }
31 | #endregion
32 |
33 | #region 登录
34 | protected override async Task