43 lines
838 B
C#
43 lines
838 B
C#
#define TRACE
|
||
#define DEBUG
|
||
using System;
|
||
using System.Diagnostics;
|
||
using System.IO;
|
||
using System.Text;
|
||
|
||
namespace qk30ic;
|
||
|
||
internal class ConRead
|
||
{
|
||
public static uint ReadConFile(ref string[] con)
|
||
{
|
||
try
|
||
{
|
||
string text = Directory.GetCurrentDirectory() + "\\" + Form1.CONFIG_PATH;
|
||
Debug.WriteLine(text);
|
||
using StreamReader streamReader = new StreamReader(text, Encoding.GetEncoding("shift_jis"));
|
||
int num = 0;
|
||
string text2 = "";
|
||
while ((text2 = streamReader.ReadLine()) != null)
|
||
{
|
||
if (text2.Length > 0)
|
||
{
|
||
string text3 = text2.Substring(0, 1);
|
||
if (text3 != "#")
|
||
{
|
||
Debug.WriteLine(num + ":" + text2);
|
||
con[num++] = text2;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
Debug.WriteLine("★★_ERROR_27");
|
||
Trace.WriteLine(ex.Message);
|
||
return 1u;
|
||
}
|
||
return 0u;
|
||
}
|
||
}
|