Exemple #1
0
        public void ProcessPacket(SoftInfo sf)
        {
            OpereatProcess op = new OpereatProcess();

            if (sf.status.Equals(SoftStatus.Open))
            {
                op.StartProcess(sf.SoftPath);
            }
            else if (sf.status.Equals(SoftStatus.Close))
            {
                op.KillProcess(sf.SoftName);
            }
        }
Exemple #2
0
        //组包发给子服务
        public static void SendPackToSubService(string ip, LANAllComputerIp.ComputerStatus cs)
        {
            PacketInfo       pinfo = new PacketInfo();
            LANAllComputerIp lan   = new LANAllComputerIp();

            lan.GetLocalMachineIp();
            lan.localMachine.status = cs;
            pinfo.ip.Add(lan.localMachine);
            SoftInfo sinfo = new SoftInfo();

            sinfo.SoftName = "coach.exe";
            sinfo.status   = SoftStatus.Init;
            pinfo.soft.Add(sinfo);
            Packet pt   = new Packet();
            var    data = pt.Package(pinfo);

            Form_Main.sc.SendInfo(ip, data);
        }
Exemple #3
0
        private void SendDataTest(LANAllComputerIp.ComputerStatus cs)
        {
            PacketInfo       pinfo = new PacketInfo();
            LANAllComputerIp lan   = new LANAllComputerIp();

            lan.GetLocalMachineIp();
            lan.localMachine.status = cs;
            pinfo.ip.Add(lan.localMachine);
            SoftInfo sinfo = new SoftInfo();

            sinfo.SoftName = "coach.exe";
            sinfo.status   = SoftStatus.Init;
            pinfo.soft.Add(sinfo);
            Packet pt   = new Packet();
            var    data = pt.Package(pinfo);

            sc.SendInfo(/*lan.localMachine.ip*/ "172.16.0.125", data);//206
        }