Beispiel #1
0
        public USBXpress()
        {
            int numDevices = 0;

            if (tipo != TypeOS.i64)
            {
                try
                {
                    USBXpress32.SI_GetNumDevices(ref numDevices);
                    tipo = TypeOS.x86;
                }
                catch (Exception)
                {
                    try
                    {
                        USBXpress64.SI_GetNumDevices(ref numDevices);
                        tipo = TypeOS.i64;
                    }
                    catch (Exception)
                    {
                        tipo = TypeOS.None;
                        MessageBox.Show("Error opening DLL API for USB. Check Instalation.");
                    }
                }
            }
            else
            {
                try
                {
                    USBXpress64.SI_GetNumDevices(ref numDevices);
                    tipo = TypeOS.i64;
                }
                catch (Exception)
                {
                    try
                    {
                        USBXpress32.SI_GetNumDevices(ref numDevices);
                        tipo = TypeOS.x86;
                    }
                    catch (Exception)
                    {
                        tipo = TypeOS.None;
                        MessageBox.Show("Error opening DLL API for USB. Check Instalation.");
                    }
                }
            }
        }
Beispiel #2
0
        public USBXpress()
        {
            int numDevices=0;
            if (tipo != TypeOS.i64)
            {
                try
                {
                    USBXpress32.SI_GetNumDevices(ref numDevices);
                    tipo = TypeOS.x86;
                }
                catch (Exception)
                {
                    try
                    {
                        USBXpress64.SI_GetNumDevices(ref numDevices);
                        tipo = TypeOS.i64;
                    }
                    catch (Exception)
                    {
                        tipo = TypeOS.None;
                        MessageBox.Show("Error opening DLL API for USB. Check Instalation.");
                    }
                }
            }
            else
            {

                try
                {
                    USBXpress64.SI_GetNumDevices(ref numDevices);
                    tipo = TypeOS.i64;
                }
                catch (Exception)
                {
                    try
                    {
                        USBXpress32.SI_GetNumDevices(ref numDevices);
                        tipo = TypeOS.x86;
                    }
                    catch (Exception)
                    {
                        tipo = TypeOS.None;
                        MessageBox.Show("Error opening DLL API for USB. Check Instalation.");
                    }
                }
            }
        }