-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.cs
More file actions
42 lines (39 loc) · 1.05 KB
/
Config.cs
File metadata and controls
42 lines (39 loc) · 1.05 KB
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
using System;
using System.Collections.Generic;
using System.IO;
namespace RPGNet
{
class Config
{
private Dictionary<String, String> Data;
public Config(String Location)
{
String[] Conf;
Data = new Dictionary<string, string>();
if (File.Exists(Location))
{
foreach (String Line in File.ReadAllLines(Location))
{
Conf = Line.Split(':');
Data.Add(Conf[0].Trim(), Conf[2]);
}
}
else
{
File.AppendAllText(Location, "ilasm: " + @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe");
Data.Add("ilasm", @"C:\Windows\Microsoft.NET\Framework\v4.0.30319\ilasm.exe");
}
}
public String getConf(String Key)
{
if (Data.ContainsKey(Key))
{
return Data[Key];
}
else
{
return "";
}
}
}
}