Пример #1
0
        private void InitAccount()
        {
            lvAcctList.BeginUpdate();

            lvAcctList.Items.Clear();

            ListViewItem item        = null;
            string       strAccount  = "";
            string       strAcctName = "";

            int nCount = m_iYuantaAPI.YOA_GetAccountCount();

            for (int i = 0; i < nCount; i++)
            {
                item = new ListViewItem(Convert.ToString(i + 1));

                strAccount = m_iYuantaAPI.YOA_GetAccount(i);
                if (1 == strAccount.Length % 2)
                {
                    strAccount = strAccount.Insert(5, "-");
                    strAccount = strAccount.Insert(3, "-");
                }
                else
                {
                    strAccount = strAccount.Insert(8, "-");
                    strAccount = strAccount.Insert(4, "-");
                }

                strAcctName = m_iYuantaAPI.YOA_GetAccountInfo(CommDef.ACCOUNT_INFO_NAME, strAccount);

                item.SubItems.Add(strAccount);
                item.SubItems.Add(strAcctName);

                lvAcctList.Items.Add(item);
            }


            lvAcctList.EndUpdate();
        }