Exemplo n.º 1
0
        /// <summary>
        /// 刷新容器
        /// </summary>
        public void RefreshActualScreens()
        {
            try
            {
                ActualScreens.Clear();
                MonitorEnumProc callback = (IntPtr hDesktop, IntPtr hdc, ref Rect prect, int d) =>
                {
                    ActualScreens.Add(new MonitorInfo()
                    {
                        Bounds = new Rectangle()
                        {
                            X      = prect.left,
                            Y      = prect.top,
                            Width  = prect.right - prect.left,
                            Height = prect.bottom - prect.top,
                        },
                        IsPrimary = (prect.left == 0) && (prect.top == 0),
                    });
                    Hashtable hs = new Hashtable();
                    hs.Add("ip", GetSystemInfo.GetClientLocalIPv4Address());
                    RZMRequest.Get.QueryGetWebService("http://192.168.13.97:8080/GxgyService.asmx", "GetBreakScreen", hs);
                    return(true);
                };

                EnumDisplayMonitors(IntPtr.Zero, IntPtr.Zero, callback, 0);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex);
            }
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String userName = txtUserName.Text;
            String password = txtPassword.Text;

            if (String.IsNullOrEmpty(userName))
            {
                MessageBox.Show("用户名不能为空");
                return;
            }
            if (String.IsNullOrEmpty(password))
            {
                MessageBox.Show("密码不能为空");
                return;
            }
            //登录获取loginToken
            String macAddress = GetSystemInfo.getMacAddr_Local();
            BaseResponse <CurrentUserInfo> loginResponse = AccountService.login(userName, password);

            if (!loginResponse.isSuccessd())
            {
                MessageBox.Show(loginResponse.Message);
                return;
            }
            //获取店铺信息
            BaseResponse <Shop> getCurrentUserShopResponse = ShopService.getCurrentUserShop();

            if (!getCurrentUserShopResponse.isSuccessd())
            {
                MessageBox.Show(getCurrentUserShopResponse.Message);
                return;
            }
            //AppConstant.sellerId = getCurrentUserShopResponse.Data.SellerId;
            //AppConstant.mwsAuthToken = getCurrentUserShopResponse.Data.MwsAuthToken;
            if (String.IsNullOrEmpty(getCurrentUserShopResponse.Data.SellerId) ||
                String.IsNullOrEmpty(getCurrentUserShopResponse.Data.MwsAuthToken) ||
                String.IsNullOrEmpty(getCurrentUserShopResponse.Data.ShopMarketplaceId)
                )
            {
                MessageBox.Show("店铺信息不完整");
                return;
            }
            AppConstant.dealInfoAppend("开始同步数据");
            if (AppConstant.threadShowDealInfo != null)
            {
                AppConstant.threadShowDealInfo.Abort();
            }
            AppConstant.threadShowDealInfo = new Thread(new ThreadStart(
                                                            showDealInfo));
            AppConstant.threadShowDealInfo.Start(); //启动线程
            shop = getCurrentUserShopResponse.Data;
            if (AppConstant.threadSynOrder != null)
            {
                AppConstant.threadSynOrder.Abort();
            }
            AppConstant.threadSynOrder = new Thread(new ThreadStart(
                                                        synOrder));
            AppConstant.threadSynOrder.Start(); //启动线程
        }
Exemplo n.º 3
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
            {
            }
        }
Exemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            string mac = GetSystemInfo.GetLoaclMac();

            if (!string.IsNullOrEmpty(mac))
            {
                textBox1.Text = mac;
            }
        }
Exemplo n.º 5
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[]
                {
                    "İşlemci (CPU)",
                    CihazYardımcısı.GetCpuName(),
                    "Bellek (RAM)",
                    string.Format("{0} MB", CihazYardımcısı.GetTotalRamAmount()),
                    "Ekran Kartı (GPU)",
                    CihazYardımcısı.GetGpuName(),
                    "Kullanıcı Adı",
                    WindowsAccountHelper.GetName(),
                    "PC Adı",
                    SystemHelper.GetPcName(),
                    "Domain İsmi",
                    domainName,
                    "Host İsmi",
                    hostName,
                    "Sistem Sürücüsü",
                    Path.GetPathRoot(Environment.SystemDirectory),
                    "Sistem Dizini",
                    Environment.SystemDirectory,
                    "Açık Olma Süresi",
                    SystemHelper.GetUptime(),
                    "MAC Adresi",
                    CihazYardımcısı.GetMacAddress(),
                    "LAN IP Adresi",
                    CihazYardımcısı.GetLanIp(),
                    "WAN IP Adresi",
                    GeoLocationHelper.GeoInfo.Ip,
                    "Antivirus",
                    SystemHelper.GetAntivirus(),
                    "Güvenlik Duvarı",
                    SystemHelper.GetFirewall(),
                    "Saat Dilimi",
                    GeoLocationHelper.GeoInfo.SaatDilimi,
                    "Ülke",
                    GeoLocationHelper.GeoInfo.Ülke,
                    "ISP",
                    GeoLocationHelper.GeoInfo.Isp
                };

                new GetSystemInfoResponse(infoCollection).Execute(client);
            }
            catch
            {
            }
        }
Exemplo n.º 6
0
        private void Execute(ISender client, GetSystemInfo message)
        {
            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();
                var userAccount = new UserAccount();

                List <Tuple <string, string> > lstInfos = new List <Tuple <string, string> >
                {
                    new Tuple <string, string>("Processor (CPU)", HardwareDevices.CpuName),
                    new Tuple <string, string>("Memory (RAM)", $"{HardwareDevices.TotalPhysicalMemory} MB"),
                    new Tuple <string, string>("Video Card (GPU)", HardwareDevices.GpuName),
                    new Tuple <string, string>("Username", userAccount.UserName),
                    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", HardwareDevices.MacAddress),
                    new Tuple <string, string>("LAN IP Address", HardwareDevices.LanIpAddress),
                    new Tuple <string, string>("WAN IPv4 Address", geoInfo.IPv4Address),
                    new Tuple <string, string>("WAN IPv6 Address", geoInfo.IPv6Address),
                    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 (Exception)
            {
                //cant get
            }
        }
Exemplo n.º 7
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
            {
            }
        }
Exemplo n.º 8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string _license, license;

            _license = GetSystemInfo.GetLicense();
            license  = tbxLicense.Text;

            if (license.Length == 32 && _license == license)
            {
                Setting.SetLicense(license);
                MessageBox.Show("注册成功,点击确定后程序自动重新启动.");
                Application.Exit();
                Application.Restart();
            }
            else
            {
                MessageBox.Show("注册码错误,请重新输入.");
                return;
            }
        }
Exemplo n.º 9
0
        internal static BaseResponse <Shop> getCurrentUserShop()
        {
            String macAddress = GetSystemInfo.getMacAddr_Local();
            string loginToken = AppConstant.loginToken;

            if (String.IsNullOrEmpty(macAddress))
            {
                return(BaseResponse <Shop> .failMessage("macAddress不能为空"));
            }
            if (String.IsNullOrEmpty(loginToken))
            {
                return(BaseResponse <Shop> .failMessage("loginToken不能为空"));
            }
            IDictionary <string, string> textParams = new Dictionary <string, string>();

            textParams.Add("macAddress", macAddress);
            textParams.Add("loginToken", loginToken);
            string resJson = new HttpUtils().DoPost(AppConstant.getCurrentUserShopUrl, textParams);
            BaseResponse <Shop> baseResponse = JsonNewtonsoft.FromJSON <BaseResponse <Shop> >(resJson);

            return(baseResponse);
        }
Exemplo n.º 10
0
 private void Awake()
 {
     this.bgTex.mainTexture = Resources.Load <Texture2D>("Other/loginBg/ui_pic_denglu");
     Debug.Log(GetSystemInfo.Dump());
     if (SystemInfo.supports3DTextures && SystemInfo.supportsStencil > 0)
     {
         Application.backgroundLoadingPriority = ThreadPriority.High;
     }
     this.init = false;
     base.StartCoroutine(this.InitVersionAndBugly());
     this.LoadConfig();
     this.AutoAjustQualitySetting();
     this.sr.AdjustResolution();
     Debug.Log("Resolution: " + Screen.currentResolution);
     DOTween.Init(null, null, null);
     DOTween.defaultEaseType = Ease.Linear;
     Physics.IgnoreLayerCollision(LayerMask.NameToLayer("SceneEntity"), LayerMask.NameToLayer("SceneEntity"));
     Physics.IgnoreLayerCollision(LayerMask.NameToLayer("SceneEntity"), LayerMask.NameToLayer("TransparentBuilding"));
     if (!Directory.Exists(Util.DataPath))
     {
         Directory.CreateDirectory(Util.DataPath);
     }
 }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            string applicationPath = System.AppDomain.CurrentDomain.BaseDirectory;
            bool   noInstance;
            Mutex  mutex = new Mutex(true, "Global\\" + Assembly.GetExecutingAssembly().FullName, out noInstance);

            if (noInstance)
            {
                if (GetSystemInfo.GetLoaclMac() == string.Empty)
                {
                    MessageBox.Show("未发现本地网卡,程序未能启动。");
                    return;
                }
                string _license     = Setting.GetLicense();
                bool   checkLicense = GetSystemInfo.CheckLicense(_license);
                if (!checkLicense)
                {
                    // 弹出注册窗口
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new frmReg());
                }
                else
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new frmMain1());
                    mutex.ReleaseMutex();
                }
            }
            else
            {
                MessageBox.Show("程序已经启动,请不要同时运行多次。");
                Application.Exit();
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public async Task <object> Get(GetSystemInfo request)
        {
            var result = await _appHost.GetSystemInfo(CancellationToken.None).ConfigureAwait(false);

            return(ToOptimizedResult(result));
        }
Exemplo n.º 13
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetSystemInfo request)
        {
            var result = _appHost.GetSystemInfo();

            return(ToOptimizedResult(result));
        }
Exemplo n.º 14
0
        public void GetMACAddressTest()
        {
            string Temp_strMacAddr = GetSystemInfo.GetMACAddress();

            Assert.AreEqual(Temp_strMacAddr, "1");
        }
Exemplo n.º 15
0
 /// <summary>
 /// 获取本机基本信息
 /// </summary>
 private void GetLocalBaseInfo()
 {
     GlobalInfo.localIP       = GetSystemInfo.getIP();
     GlobalInfo.localUserName = GetSystemInfo.getUserName();
 }