public static async Task GetAllUri()
        {
            connectionList.Clear();
            var allConnections = await WcfClient.WcfClient_DiscoverChannel();

            foreach (var x in allConnections)
            {
                IPcInfoSender channel     = WcfClient.WcfClient_SetupChannel(x.ToString());
                RuntimeInfo   runtimeInfo = channel.GetRuntimeInformation();
                connectionList.Add(new Models.Connection(x.ToString(), runtimeInfo.ComputerName));
            }
        }
Example #2
0
        public async Task <ActionResult> KillProcess(int pid, string IP)
        {
            try
            {
                IPcInfoSender channel = WcfClient.WcfClient_SetupChannel(IP);
                channel.KillProcess(pid);
                return(RedirectToAction("Index", "Info", new { IP = IP }));
            }
            catch (Exception e)
            {
                ViewData["errorMessage"] = "Oops, you lost connection. Try again later.";
                await ConnectionManager.GetAllUri();

                return(View("~/Views/Connection/ConnectionList.cshtml"));
            }
        }
Example #3
0
        public async Task <ActionResult> Index(string IP)
        {
            try
            {
                IPcInfoSender channel = WcfClient.WcfClient_SetupChannel(IP);
                ViewData["runtimeInfos"]  = channel.GetRuntimeInformation();
                ViewData["diskSpaceInfo"] = channel.GetDeviceInformation();
                ViewData["processes"]     = channel.GetAllProcess();
                ViewData["services"]      = channel.GetAllServices();
                ViewData["ip"]            = IP;
                return(View("InfoList"));
            }
            catch (Exception e)
            {
                ViewData["errorMessage"] = "The requested IP address cannot be reached.";
                await ConnectionManager.GetAllUri();

                return(View("~/Views/Connection/ConnectionList.cshtml"));
            }
        }
Example #4
0
 public void TestTearDown()
 {
     sut = null;
 }
Example #5
0
 public void TestSetup()
 {
     sut = new PcInfoSender();
 }