Exemplo n.º 1
0
        /// <summary>
        /// 입력받은 문자열이 cash code의 패턴인지를 확인함.
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        private List <HMCode> parseCode(string strCode)
        {
            Regex           regex      = new Regex(@"([0-9]{4})-([0-9]{4})-([0-9]{4})-([0-9]{4})_([0-9]{8})");
            var             trimStr    = strCode.Replace(" ", "");
            MatchCollection matchCodes = regex.Matches(trimStr);

            List <HMCode> codeList = new List <HMCode>();

            if (matchCodes.Count > 0)
            {
                foreach (Match code in matchCodes)
                {
                    HMCode hc = new HMCode();
                    for (int i = 0; i < 4; i++)
                    {
                        hc.pinNums.Add($"{code.Groups[i + 1]}");
                    }
                    hc.issuedate = $"{code.Groups[5]}";

                    codeList.Add(hc);
                }

                return(codeList);
            }
            return(null);
        }
Exemplo n.º 2
0
        private async Task DoInputCode(int idx, HMCode code)
        {
            var pwdEl = doc.GetElementById($"pinNo1_{idx}");

            pwdEl.Focus();

            for (int j = 0; j < code.pinNums.Count; j++)
            {
                pwdEl = doc.GetElementById($"pinNo{j + 1}_{idx}");
                pwdEl.Focus();

                InputSimulator.Write(code.pinNums[j]);
                await Task.Delay(300);
            }

            pwdEl = doc.GetElementById($"issuedDate_{idx}");
            pwdEl.Focus();

            InputSimulator.Write(code.issuedate);
            await Task.Delay(300);
        }