Пример #1
0
        internal static List <IISSites> AssignProcessIds(List <IISSites> iisSites)
        {
            var onGoingIISProcesses = Process.GetProcessesByName("iisexpress");

            foreach (var process in onGoingIISProcesses)
            {
                string commandLine = ProcessCommandLineFinder.FindProcessStartCommandLineByProcessId(process.Id);
                if (commandLine.Contains("/site:\""))
                {
                    string siteName = FindSiteName(commandLine);
                    iisSites = MapSiteNameWithProcessId(iisSites, process.Id.ToString(), siteName);
                }
            }
            return(iisSites);
        }
Пример #2
0
        internal static void FindWebsite()
        {
            List <string> list = ProcessCommandLineFinder.FindAllProcessStartCommandLineByProcessName("iisexpress");

            foreach (string listItem in list)
            {
                if (listItem.Contains("/site:\""))
                {
                    FindSiteName(listItem);
                }
                else if (listItem.Contains("/siteId:"))
                {
                    Console.WriteLine("type2: " + listItem);
                }
            }
        }