Пример #1
0
 public List <Info_Devices> GetDevices2_Running()
 {
     try
     {
         int                 j              = 0;
         List <string>       list_adb_id    = ADBHelper.GetDevices();
         List <Info_Devices> listLDPlayer   = new List <Info_Devices>();
         List <string>       device_running = GetDevices_Running();
         string[]            arr            = ExecuteLD_Result("list2").Trim().Split('\n');
         for (int i = 0; i < arr.Length; i++)
         {
             Info_Devices devices = new Info_Devices();
             string[]     aDetail = arr[i].Trim().Split(',');
             devices.index = int.Parse(aDetail[0]);
             devices.name  = aDetail[1];
             if (device_running.Contains(devices.name))
             {
                 devices.adb_id = list_adb_id[j];
                 listLDPlayer.Add(devices);
                 j++;
             }
         }
         return(listLDPlayer);
     }
     catch
     {
         return(new List <Info_Devices>());
     }
     //System.Windows.Forms.MessageBox.Show(string.Join("\n", arr));
 }
Пример #2
0
        public List <Info_Devices> GetDevices2()
        {
            List <Info_Devices> listLDPlayer = new List <Info_Devices>();

            string[] arr = ExecuteLD_Result("list2").Trim().Split('\n');
            for (int i = 0; i < arr.Length; i++)
            {
                Info_Devices devices = new Info_Devices();
                string[]     aDetail = arr[i].Trim().Split(',');
                devices.index  = int.Parse(aDetail[0]);
                devices.name   = aDetail[1];
                devices.adb_id = "-1";
                listLDPlayer.Add(devices);
            }
            //System.Windows.Forms.MessageBox.Show(string.Join("\n", arr));
            return(listLDPlayer);
        }