Ejemplo n.º 1
0
 public MyThread(ProcessStartInfo startInfo, OnProcessListener listener, int processType)
 {
     this.startInfo   = startInfo;
     this.listener    = listener;
     this.processType = processType;
     thread           = new Thread(new ThreadStart(startProcess));
     thread.Name      = "StartProcess";
     logList          = new List <String>();
 }
Ejemplo n.º 2
0
 //连接设备
 public static void callConnect(String batPath, String device, OnProcessListener onProcessListener)
 {
     if (onProcessListener == null)
     {
         return;
     }
     try{
         myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] { device }), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_START_CONNECT);
         myThread.start();
     }catch (Exception e) {
     }
 }
Ejemplo n.º 3
0
        //获取当前连接的设备
        public static void getDevices(String batPath, OnProcessListener onProcessListener)
        {
            if (onProcessListener == null)
            {
                return;
            }

            try
            {
                myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] {}), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_GET_DEVICES);
                myThread.start();
            }
            catch (Exception e) {
            }
        }
Ejemplo n.º 4
0
        //断开vpn
        public static void callDisconnectVpn(String batPath, String vpnName, OnProcessListener onProcessListener)
        {
            if (onProcessListener == null)
            {
                return;
            }

            try
            {
                myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] { vpnName }), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_DISCONNECT_VPN);
                myThread.start();
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 5
0
        public static void callDeleteRandomFile(String batPath, OnProcessListener onProcessListener)
        {
            if (onProcessListener == null)
            {
                return;
            }

            try
            {
                myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] { }), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_DELETE_RANDOM);
                myThread.start();
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 6
0
        public static void callPullTimeFile(String batPath, String targetPath, OnProcessListener onProcessListener)
        {
            if (onProcessListener == null)
            {
                return;
            }

            try
            {
                myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] { targetPath }), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_PULL_TIME);
                myThread.start();
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 7
0
        //启动修改prop
        public static void callProp(String batPath, String device, String propPath, OnProcessListener onProcessListener)
        {
            if (onProcessListener == null)
            {
                return;
            }

            try
            {
                myThread = new MyThread(ThreadUtil.getBatOrExeStartInfo(batPath, new String[] { device, propPath }), onProcessListener, Constant.ProcessType.TYPE_OF_PROCESS_CHANGE_PROP);
                myThread.start();
            }
            catch (Exception e)
            {
            }
        }