コード例 #1
0
        private async void onKeyEntered(string username, string key)
        {
            if (key.Length == 0)
            {
                handleLicenceError(LicenceError.ERROR_INVALID_KEY);
                return;
            }

            bool haveInternetConnection = System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();

            if (!haveInternetConnection)
            {
                handleLicenceError(LicenceError.ERROR_NO_INTERNET_CONNECTION);
                return;
            }

            _activationWindow.setBlockedView(true);
            _userKey = key;

            await utils.Utils.getMachineUniqueIdAsync((string machineId) =>
            {
                _machineId          = machineId;
                string machineIdMD5 = utils.Utils.createMD5ForString(_machineId);
                ServerCommandManager.requestProductActivation(username, key, machineIdMD5, onActivationRequestCompleted);
            });
        }