public string Test(string IP, short Port, string Version, short YybID, string AccountNo, string TradeAccount, string JyPassword, string TxPassword) { try { StringBuilder Result = new StringBuilder(1024 * 1024); StringBuilder ErrInfo = new StringBuilder(256); int ClientID = TdxApi.Logon(IP, Port, Version, YybID, AccountNo, TradeAccount, JyPassword, TxPassword, ErrInfo); if (ClientID == -1) { return(string.Format("{0}|{1}", ClientID, ErrInfo)); } TdxApi.QueryData(ClientID, 5, Result, ErrInfo); TdxApi.Logoff(ClientID); return(string.Format("{0}|{1}", Result, ErrInfo)); } catch (Exception ex) { return(ex.Message); } }
public bool Test(string IP, short Port, string Version, short YybID, string AccountNo, string TradeAccount, string JyPassword, string TxPassword) { try { StringBuilder Result = new StringBuilder(1024 * 1024); StringBuilder ErrInfo = new StringBuilder(256); int ClientID = TdxApi.Logon(IP, Port, Version, YybID, AccountNo, TradeAccount, JyPassword, TxPassword, ErrInfo); if (ClientID == -1) { MessageBox.Show("登录测试失败:" + ErrInfo.ToString()); return(false); } TdxApi.QueryData(ClientID, 5, Result, ErrInfo); TdxApi.Logoff(ClientID); return(true); } catch (Exception ex) { CommonUtils.Log("组合号添加异常:" + ex.Message); return(false); } }
public void Logoff() { try { if (this.IsIMSAccount) { ImsApi.ImsPbClient_Disconnect(); } else { TdxApi.Logoff(this.ClientID); } } catch { } this.ClientID = -1; }