using System.IO;
|
|
using System.Windows.Forms;
|
|
using Forks.Utils.IO;
|
|
|
|
namespace ClientForWEDS {
|
|
public class ConfigUtil {
|
|
public static string ConfigFilePath = Application.StartupPath + "\\Config.txt";
|
|
public static string RdPath = Application.StartupPath + "\\record\\";
|
|
public static void Init() {
|
|
using (TextReader reader = FS.OpenReader(ConfigFilePath, true)) {
|
|
var nutFile = NutFile.Parse(reader);
|
|
|
|
IP1 = nutFile.AsString(ConfigItem.IP1, "");
|
|
IP2 = nutFile.AsString(ConfigItem.IP2, "");
|
|
IP3 = nutFile.AsString(ConfigItem.IP3, "");
|
|
Port = nutFile.AsString(ConfigItem.Port, "3350");
|
|
Timeout = nutFile.AsString(ConfigItem.Timeout, "8000");
|
|
ValidateType = nutFile.AsString(ConfigItem.ValidateType, "no");
|
|
ZDPath = nutFile.AsString(ConfigItem.ZDPath, @"\\updata\wdjl.wds");
|
|
ERPURL = nutFile.AsString(ConfigItem.ERPURL, @"http://");
|
|
UserName = nutFile.AsString(ConfigItem.UserName, "");
|
|
Password = nutFile.AsString(ConfigItem.Password, "");
|
|
}
|
|
|
|
}
|
|
public static string IP1;
|
|
public static string IP2;
|
|
public static string IP3;
|
|
|
|
public static string Port;
|
|
public static string Timeout;
|
|
public static string ValidateType;
|
|
public static string ZDPath;
|
|
|
|
public static string ERPURL;
|
|
public static string UserName;
|
|
public static string Password;
|
|
|
|
public class ConfigItem {
|
|
public const string IP1 = "IP1";
|
|
public const string IP2 = "IP2";
|
|
public const string IP3 = "IP3";
|
|
public const string Port = "Port";
|
|
public const string Timeout = "Timeout";
|
|
|
|
public const string ValidateType = "ValidateType";
|
|
public const string ZDPath = "ZDPath";
|
|
public const string ERPURL = "ERPURL";
|
|
public const string UserName = "UserName";
|
|
public const string Password = "Password";
|
|
|
|
}
|
|
}
|
|
}
|