diff --git a/ProgrammList.sln b/ProgrammList.sln index 1c91ef8..afd4833 100644 --- a/ProgrammList.sln +++ b/ProgrammList.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.12.35527.113 d17.12 +VisualStudioVersion = 17.12.35527.113 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProgrammList", "ProgrammList\ProgrammList.csproj", "{06D431CD-A938-4DFD-8D77-4C612FDAD914}" EndProject @@ -15,8 +15,8 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|Any CPU.Build.0 = Release|Any CPU + {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|Any CPU.Build.0 = Debug|Any CPU {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|x64.ActiveCfg = Debug|x64 {06D431CD-A938-4DFD-8D77-4C612FDAD914}.Debug|x64.Build.0 = Debug|x64 {06D431CD-A938-4DFD-8D77-4C612FDAD914}.PrgmList|Any CPU.ActiveCfg = PrgmList|Any CPU diff --git a/ProgrammList/ConfigManager/PrmListConfigManager.cs b/ProgrammList/ConfigManager/PrmListConfigManager.cs new file mode 100644 index 0000000..5ba04e3 --- /dev/null +++ b/ProgrammList/ConfigManager/PrmListConfigManager.cs @@ -0,0 +1,37 @@ +using System; +using System.Configuration; +using System.IO; + +namespace ProgrammList.ConfigManager { + public static class PrmListConfigManager { + + public static string GetSetting(string key) { + try { + ExeConfigurationFileMap configMap = new ExeConfigurationFileMap(); + Console.WriteLine("Loading " + Directory.GetCurrentDirectory() + "\\app.conf"); + configMap.ExeConfigFilename = Directory.GetCurrentDirectory() + "\\app.conf"; + Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None); + return config.AppSettings.Settings[key].Value; + } + catch (Exception e) { + Console.WriteLine("Error on Key " + key + ": " + e.ToString()); + Console.WriteLine(e.ToString()); + } + return "13"; + } + + public static void SetSetting(string key, string value) { + try { + ExeConfigurationFileMap configMap = new ExeConfigurationFileMap(); + Console.WriteLine("Loading " + Directory.GetCurrentDirectory() + "\\app.conf"); + configMap.ExeConfigFilename = Directory.GetCurrentDirectory() + "\\app.conf"; + Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None); + config.AppSettings.Settings["key"].Value = value; + } + catch (Exception e) { + Console.WriteLine("Error on Key " + key + ": " + e.ToString()); + Console.WriteLine(e.ToString()); + } + } + } +} \ No newline at end of file diff --git a/ProgrammList/Icons/prm_icon/back-end.ico b/ProgrammList/Icons/prm_icon/back-end.ico new file mode 100644 index 0000000..1be23cf Binary files /dev/null and b/ProgrammList/Icons/prm_icon/back-end.ico differ diff --git a/README.md b/README.md index 9290c08..5f5c692 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# ProgrammList \ No newline at end of file +# ProgrammList + +Ein Programm zum erstellen einer Liste installierter Programme auf einem Rechner. Man kann das Programmm in einen Netzwerkordner legen um von mehreren Systemen die Information zu bekommen und diese Zentral zu Speichern. + +Untersützt werden bisher Speichermethoden in MSSQL, Sqlite und MySql. + +Für Sqlite wird eine Dantenbankdatei über eine app.conf date erstellt. Die app.conf Datei muss sich dazu im gleichen Ordner wie die exe befinden. +Für MSSQL und MySql werden bisher Standard Parameter für IP (Localhost) und Port verwendet. + +In Späteren Versionen sollte dies auch über das Config file editierbar sein. + +Zukunftsplan: +- Oberfläche zur Einrichtung der Konfigurationsdatei. Eventuell in eigenen Branches (WinForm vs WPF) +- Zusätzliche Datenbanken und eventuell auch ein CSV report. +- Je nach .net version, Portable single exe oder ein installer \ No newline at end of file