U8APIDEMO,
//第一步:构造u8login对象并登陆(引用U8API类库中的Interop.U8Login.dll)
//如果当前环境中有login对象则可以省去第一步
U8Login.clsLogin u8Login = new U8Login.clsLogin();
String sSubId = "AS";
String sDate = DateTime.Now.ToString("yyyy-MM-dd");
String sSerial = "";
XmlDocument xmlLongin = new XmlDocument();
xmlLongin.Load(Environment.CurrentDirectory+"//config.xml");
String sAccID = xmlLongin.SelectSingleNode("/LoginInfo/AccID").InnerText;
String sYear = xmlLongin.SelectSingleNode("/LoginInfo/Year").InnerText;
String sUserID = xmlLongin.SelectSingleNode("/LoginInfo/UserID").InnerText;
String sPassword = xmlLongin.SelectSingleNode("/LoginInfo/Password").InnerText;
String sServer = xmlLongin.SelectSingleNode("/LoginInfo/Server").InnerText;
if (!u8Login.Login(ref sSubId, ref sAccID, ref sYear, ref sUserID, ref sPassword, ref sDate, ref sServer, ref sSerial))
{
Console.WriteLine("登陆失败,原因:" + u8Login.ShareString);
Marshal.FinalReleaseComObject(u8Login);
int a = Console.Read();
return;
}
Console.WriteLine("登陆成功!!")
1