Hello, I do not know how to declare a public variable, for example I would like to declare the search for a file and keep for all my application the same value. Here is my code below, how to always have the name (DBpath). Thank you in advance.
<pre> // search the disks if the folder exists string[] drives = Directory.GetLogicalDrives().Where(d => Directory.Exists(Path.Combine(d, "Dossier1"))).ToArray(); string Résult = string.Join(", ", drives); if (Résult != "") { if (Directory.Exists(Résult + @"Dossier1\")) { if (Directory.Exists(Résult + @"Dossier1\Dossier2")) { if (File.Exists(Résult + @"Dossier1\Dossier2\BDD_SQLite.db3")) { string DBpath = Résult + @"Dossier1\Dossier2\BDD_SQLite.db3"; } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)