123456789101112131415161718192021222324252627 |
- using System;
- using System.IO;
- namespace BanTur.Core.Utility
- {
- internal static class PathHelper
- {
- internal static string DbFilePath
- {
- get
- {
- var env = Environment.GetEnvironmentVariable(BanTurProgram.EnvVarDbPath);
- if (!string.IsNullOrWhiteSpace(env))
- {
- if (Directory.Exists(Path.GetDirectoryName(env))) return env;
- }
- var exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
- var exeDir = Path.GetDirectoryName(exePath);
- var fileName = Path.ChangeExtension(Path.GetFileName(exePath), "db3");
- return Path.Combine(exeDir, fileName);
- }
- }
- }
- }
|