コード例 #1
0
ファイル: CalibrationExport.cs プロジェクト: odins1970/Ogama
        private XElement GenerateEnvironment()
        {
            var enviroment = new XElement("Environment");

            try
            {
                enviroment = new XElement("Environment",
                                          new XElement("MachineName", SanitizeString(Environment.MachineName)),
                                          new XElement("CPUName", SystemInfo.CPUName()),
                                          new XElement("CPUSpeed", SystemInfo.CPUSpeed()),
                                          new XElement("CPULoad", SystemInfo.Instance.GetCPULoad()),
                                          new XElement("MemTotal", SystemInfo.Instance.GetTotalMemory()),
                                          new XElement("MemLoad", SystemInfo.Instance.GetMemLoad()),
                                          new XElement("PrimaryMonitorWidth", ScreenParameters.PrimaryResolution.Width),
                                          new XElement("PrimaryMonitoryHeight", ScreenParameters.PrimaryResolution.Height),
                                          new XElement("SecondaryMonitorWidth", ScreenParameters.SecondaryResolution.Width),
                                          new XElement("SecondaryMonitoryHeight", ScreenParameters.SecondaryResolution.Height),
                                          new XElement("UserName", SanitizeString(Environment.UserName)),
                                          new XElement("UserDomainName", SanitizeString(Environment.UserDomainName)),
                                          new XElement("OSVersion", Environment.OSVersion),
                                          new XElement("CLRVersion", Environment.Version),
                                          new XElement("IP", SystemInfo.Instance.GetIPAddress())
                                          );
            }
            catch (Exception ex)
            {
                Console.Out.WriteLine("CalibrationExport, error in GenerateEnvironment: " + ex.Message);
            }

            return(enviroment);
        }