.INI文件
[User]
USERID=zh
PWD=1
string fileName = System.Environment.CurrentDirectory + "\\NH.ini";
if (!File.Exists(System.Environment.CurrentDirectory + "\\NH.ini"))
{
File.Create(System.Environment.CurrentDirectory + "\\NH.ini");
MessageBox.Show("请先配置ConfigFile.ini文件!");
}
string USERID = SysAPI.ReadString("User", "USERID", "", fileName);
string PWD = SysAPI.ReadString("User", "PWD", "", fileName);
try
{
SysAPI.RegSvr();
int x= SysAPI.of_init(USERID.ToCharArray(),PWD.ToCharArray());
MessageBox.Show("登录成功"+x.ToString());
if (x != 0)
{
WriteLog.WriteErrorLog("登录失败" + "USERID:" + USERID + "PWD:" + PWD);
MessageBox.Show("登录失败");
return;
}
}
catch (Exception ex)
{
WriteLog.WriteErrorLog("授权失败" + ex.Message);
MessageBox.Show("授权失败" + ex.Message);
}