Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        private void PostClientInfo()
        {
            var status         = "在线";
            var request        = new RestRequest("v1/client/", Method.POST);
            var ip             = ClientDeviceHelper.GetIpAddress();
            var mac            = ClientDeviceHelper.GetMacAddress();
            var appName        = ClientDeviceHelper.GetApplicationName();
            var systemInfo     = string.Empty;
            var loadSystemInfo = configHelper.GetManifestConfigValue("LoadSystemInfo");

            if (loadSystemInfo == "1")
            {
                systemInfo = ClientDeviceHelper.GetSystemInfo();
            }
            var monitorPort = configHelper.GetManifestConfigValue("MonitorPort");

            request.RequestFormat = DataFormat.Json;
            request.AddBody(new Client
            {
                ClientMac   = mac,
                ClientIp    = ip,
                LaunchTime  = DateTime.Now,
                Status      = status,
                SystemName  = appName,
                SystemInfo  = systemInfo,
                MonitorPort = monitorPort
            });
            restClient.Execute(request);
        }
Beispiel #2
0
 string GetInfo()
 {
     return(ClientDeviceHelper.GetSystemInfo());
 }