-
Notifications
You must be signed in to change notification settings - Fork 4
/
Ut.cs
56 lines (50 loc) · 1.34 KB
/
Ut.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
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
namespace CybosAutoLogin
{
class Ut
{
public static void Log(string text)
{
Console.Write(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") + "\t" + text + "\n");
}
}
class Setting
{
public static Hashtable ReadIniFile(string path)
{
Hashtable result = new Hashtable();
return result;
}
public static string ReadIniValueByKey(string path, string key)
{
string result = null;
StreamReader sr = new StreamReader(path);
string line = "";
while ((line = sr.ReadLine()) != null)
{
if (line.Contains("="))
{
string[] words = line.Split('=');
if(words[0].CompareTo(key) == 0)
result = words[1];
}
}
sr.Close();
if (result == null)
{
Ut.Log(key + " 설정 정보가 없습니다!");
throw new Exception();
}
else
{
Ut.Log("ini loading " + key + " : " + result);
}
return result;
}
}
}