Exemple #1
0
        /// <summary>
        /// 绑定数据源
        /// </summary>
        public void BindsListViewDataSource()
        {
            this.betterListView1.Items.Clear();
            DataTable dt = new TXTClass().txtRead(Global.dbFile, '|');

            foreach (DataRow row in dt.Rows)
            {
                BetterListViewItem item = new BetterListViewItem(new string[] {
                    row[0].ToString(),
                    row[1].ToString(),
                    row[2].ToString(),
                    row[3].ToString()
                });
                item.ImageIndex = 0;
                this.betterListView1.Items.Add(item);
            }
            this.tsItemLabel.Text = string.Format("共 {0} 项", dt.Rows.Count);
        }
Exemple #2
0
        // 主窗体-加载
        private void FormRemote_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(_Action) || string.IsNullOrWhiteSpace(_ServerIp))
            {
                return;
            }

            string where = string.Format("c0='{0}'", _ServerIp);
            DataTable dt = new TXTClass().txtRead(Global.dbFile, '|', where);

            if (dt.Rows.Count > 0)
            {
                this.txtServerIp.Text = dt.Rows[0][0].ToString();
                this.txtUserName.Text = dt.Rows[0][1].ToString();
                this.txtPassword.Text = dt.Rows[0][2].ToString();
                this.txtRemark.Text   = dt.Rows[0][3].ToString();
            }
        }