コード例 #1
0
        public static void HandleGetSystemInfo(GetSystemInfo command, Client client)
        {
            try
            {
                IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();

                var domainName = (!string.IsNullOrEmpty(properties.DomainName)) ? properties.DomainName : "-";
                var hostName   = (!string.IsNullOrEmpty(properties.HostName)) ? properties.HostName : "-";


                string[] infoCollection = new string[]
                {
                    "Processor (CPU)",
                    DevicesHelper.GetCpuName(),
                    "Memory (RAM)",
                    string.Format("{0} MB", DevicesHelper.GetTotalRamAmount()),
                    "Video Card (GPU)",
                    DevicesHelper.GetGpuName(),
                    "Username",
                    WindowsAccountHelper.GetName(),
                    "PC Name",
                    SystemHelper.GetPcName(),
                    "Domain Name",
                    domainName,
                    "Host Name",
                    hostName,
                    "System Drive",
                    Path.GetPathRoot(Environment.SystemDirectory),
                    "System Directory",
                    Environment.SystemDirectory,
                    "Uptime",
                    SystemHelper.GetUptime(),
                    "MAC Address",
                    DevicesHelper.GetMacAddress(),
                    "LAN IP Address",
                    DevicesHelper.GetLanIp(),
                    "WAN IP Address",
                    GeoLocationHelper.GeoInfo.Ip,
                    "Antivirus",
                    SystemHelper.GetAntivirus(),
                    "Firewall",
                    SystemHelper.GetFirewall(),
                    "Time Zone",
                    GeoLocationHelper.GeoInfo.Timezone,
                    "Country",
                    GeoLocationHelper.GeoInfo.Country,
                    "ISP",
                    GeoLocationHelper.GeoInfo.Isp
                };

                client.Send(new GetSystemInfoResponse {
                    SystemInfos = infoCollection
                });
            }
            catch
            {
            }
        }
コード例 #2
0
        public static void HandleGetSystemInfo(GetSystemInfo command, Networking.Client client)
        {
            try
            {
                IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();

                var domainName = (!string.IsNullOrEmpty(properties.DomainName)) ? properties.DomainName : "-";
                var hostName   = (!string.IsNullOrEmpty(properties.HostName)) ? properties.HostName : "-";

                var geoInfo = GeoInformationFactory.GetGeoInformation();

                List <Tuple <string, string> > lstInfos = new List <Tuple <string, string> >
                {
                    new Tuple <string, string>("Processor (CPU)", DevicesHelper.GetCpuName()),
                    new Tuple <string, string>("Memory (RAM)", $"{DevicesHelper.GetTotalRamAmount()} MB"),
                    new Tuple <string, string>("Video Card (GPU)", DevicesHelper.GetGpuName()),
                    new Tuple <string, string>("Username", WindowsAccountHelper.GetName()),
                    new Tuple <string, string>("PC Name", SystemHelper.GetPcName()),
                    new Tuple <string, string>("Domain Name", domainName),
                    new Tuple <string, string>("Host Name", hostName),
                    new Tuple <string, string>("System Drive", Path.GetPathRoot(Environment.SystemDirectory)),
                    new Tuple <string, string>("System Directory", Environment.SystemDirectory),
                    new Tuple <string, string>("Uptime", SystemHelper.GetUptime()),
                    new Tuple <string, string>("MAC Address", DevicesHelper.GetMacAddress()),
                    new Tuple <string, string>("LAN IP Address", DevicesHelper.GetLanIp()),
                    new Tuple <string, string>("WAN IP Address", geoInfo.IpAddress),
                    new Tuple <string, string>("ASN", geoInfo.Asn),
                    new Tuple <string, string>("ISP", geoInfo.Isp),
                    new Tuple <string, string>("Antivirus", SystemHelper.GetAntivirus()),
                    new Tuple <string, string>("Firewall", SystemHelper.GetFirewall()),
                    new Tuple <string, string>("Time Zone", geoInfo.Timezone),
                    new Tuple <string, string>("Country", geoInfo.Country)
                };

                client.Send(new GetSystemInfoResponse {
                    SystemInfos = lstInfos
                });
            }
            catch
            {
            }
        }
コード例 #3
0
        public static void HandleGetSystemInfo(Packets.ServerPackets.GetSystemInfo command, Client client)
        {
            try
            {
                string[] infoCollection = new string[]
                {
                    "Processor (CPU)",
                    DevicesHelper.GetCpuName(),
                    "Memory (RAM)",
                    string.Format("{0} MB", DevicesHelper.GetTotalRamAmount()),
                    "Video Card (GPU)",
                    DevicesHelper.GetGpuName(),
                    "Username",
                    WindowsAccountHelper.GetName(),
                    "PC Name",
                    SystemHelper.GetPcName(),
                    "Uptime",
                    SystemHelper.GetUptime(),
                    "MAC Address",
                    DevicesHelper.GetMacAddress(),
                    "LAN IP Address",
                    DevicesHelper.GetLanIp(),
                    "WAN IP Address",
                    GeoLocationHelper.GeoInfo.ip,
                    "Antivirus",
                    SystemHelper.GetAntivirus(),
                    "Firewall",
                    SystemHelper.GetFirewall()
                };

                new Packets.ClientPackets.GetSystemInfoResponse(infoCollection).Execute(client);
            }
            catch
            {
            }
        }
コード例 #4
0
 IEnumerator ChangeNestHelper()
 {
     return(DevicesHelper.ChangeNestHelper("79", "\"heat\""));
 }