コード例 #1
0
 // Helper function for getting a list of all EXEs and DLLs in the current application folder
 public static List <string> GetAssemblyFiles()
 {
     string[] exts = new string[2] {
         "*.exe", "*.dll"
     };
     return(ApplicationUtility.GetAssemblyFiles(ApplicationUtility._applicationBinFolder, exts, SearchOption.AllDirectories));
 }
コード例 #2
0
        // Helper function for getting a list of filename and version numbers of all assembly files (EXEs and DLLs) in the
        // current application folder
        public static List <string> GetApplicationComponentVersions()
        {
            List <string> stringList = new List <string>();

            string[] exts = new string[2] {
                "*.exe", "*.dll"
            };
            foreach (string assemblyFile in ApplicationUtility.GetAssemblyFiles(ApplicationUtility._applicationBinFolder, exts, SearchOption.AllDirectories))
            {
                FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(assemblyFile);
                if (!string.IsNullOrEmpty(versionInfo.Comments))
                {
                    string str = string.Format("{0} ({1}) - version: {2}", (object)versionInfo.Comments, (object)versionInfo.InternalName, (object)versionInfo.FileVersion);
                    stringList.Add(str);
                }
            }
            return(stringList);
        }