예제 #1
0
        public static AppInfo GetAppInfo()
        {
            ISysInfoHelper sih = new SysInfoHelper();

            var result = new AppInfo();

            try
            {
                result.AppVersion     = sih.GetAppVersion();
                result.ComputerName   = sih.GetComputerName();
                result.MAC            = sih.GetMAC();
                result.RuntimeVersion = sih.GetRuntimeVersion();

                var ini = new IniFileOperator(IniFileOperator.IniFileName);
                result.AppId = ini.ReadValue("Application", "AppId", "");
                //Serial Number
                result.SN = ini.ReadValue("Application", "SN", "");
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            return(result);
        }
예제 #2
0
        static AppHelper()
        {
            try
            {
                ISysInfoHelper sih = new SysInfoHelper();
                STR_USEA_AGENT_DEFAULT = sih.GetUserAgentForIE();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
#if DEBUG
                throw;
#endif
            }
        }
예제 #3
0
파일: AppInfo.cs 프로젝트: sw0/RegexTool
        public StartUpInfo(AppInfo appInfo)
        {
            this.AppId          = appInfo.AppId;
            this.MAC            = appInfo.MAC;
            this.ComputerName   = appInfo.ComputerName;
            this.AppVersion     = appInfo.AppVersion;
            this.RuntimeVersion = appInfo.RuntimeVersion;

            SysInfoHelper sih = new SysInfoHelper();

            this.CDriveSerialNumber = sih.GetDiskVolumeSerialNumber(null);
            this.CPUNumber          = sih.GetCpu();

            var ini = new IniFileOperator(IniFileOperator.IniFileName);
            //Serial Number
            string sn = ini.ReadValue("Application", "SN", "");

            var encdec = new EncDec();

            this.PublicKeyHash = encdec.GetMd5Hash(AppHelper.STR_PUBLIC_KEY);
            this.SN            = sn;
        }