Exemple #1
0
 public Main(string szDevice)
 {
     CheckForIllegalCrossThreadCalls = false; 
     InitializeComponent();
     Device.Text = "Device Info: " + szDevice;
     pl = new ProcessLayer(ProcStatus, txt_Log);
 }
Exemple #2
0
        private bool Chk_Device(ref string szRet)
        {
            ProcessLayer pl = new ProcessLayer();
            bool bSuccess = pl.SyncStart("nfc/nfc-list.exe", null);

            if (!bSuccess)
            {
                szRet = "Error! Can not connect to the device";
                return false;
            }
            string[] RegexRet = RegexStringLayer.GetSubString(pl.m_RetOutputMsg.ToString(), "NFC device:\\s*(.+)\\s*/");

            bool bRet;
            if (string.IsNullOrWhiteSpace(RegexRet[0]))
            {
                bRet = false;
                szRet = "Error! Can not connect to the device";
            }
            else
            {
                bRet = true;
                szRet = "Device: " + RegexRet[0];
                szDevice.Append(RegexRet[0]);
            }

            return bRet;
        }