Ejemplo n.º 1
0
        public static bool TryGetByDirectoryPath(string dirPath, out WiresharkDirectory output)
        {
            string wsPath = dirPath + "wireshark.exe";
            string tsPath = dirPath + "tshark.exe";
            string ciPath = dirPath + "capinfos.exe";

            if (File.Exists(wsPath) && File.Exists(tsPath) && File.Exists(ciPath))
            {
                output = new WiresharkDirectory(wsPath, tsPath, ciPath);
                return(true);
            }
            output = null;
            return(false);
        }
Ejemplo n.º 2
0
        public static bool TryGetByPath(string path, out WiresharkDirectory output)
        {
            output = null;
            if (path == null)
            {
                return(false);
            }

            if (path.ToUpper().EndsWith(".EXE"))
            {
                path = Path.GetDirectoryName(path);
            }

            if (!path.EndsWith(Path.DirectorySeparatorChar.ToString()))
            {
                path += Path.DirectorySeparatorChar;
            }

            return(TryGetByDirectoryPath(path, out output));
        }