-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.cs
44 lines (40 loc) · 1.02 KB
/
Config.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.IO;
using System.Xml;
namespace nginx_php_manager.lib
{
public class Config
{
public enum ConfigStatus
{
SUCCESS,
FAILED,
NO_CONFIG
};
private static string configFileName = "config";
private static XmlDocument configDocumment;
private Config() { }
public static ConfigStatus read()
{
if (File.Exists(configFileName))
{
configDocumment = new XmlDocument();
try
{
configDocumment.Load(
string.Format("{0}\\{1}.xml", Directory.GetCurrentDirectory(), configFileName)
);
return ConfigStatus.SUCCESS;
}
catch
{
return ConfigStatus.FAILED;
}
}
else
{
return ConfigStatus.NO_CONFIG;
}
}
}
}