Esempio n. 1
0
        private void LoadAttackList()
        {
            List <AttackData> atkdatalist = AttackData.GetAttackDataList();
            string            imageurlstring;
            string            url;

            dtAttack = new DataTable();
            dtAttack.Columns.Add("AttackId", typeof(int));
            dtAttack.Columns.Add("AttackName", typeof(string));
            dtAttack.Columns.Add("AttackInfo", typeof(string));
            dtAttack.Columns.Add("AttackPic1", typeof(string));
            foreach (AttackData atkdata in atkdatalist)
            {
                imageurlstring = Convert.ToBase64String(atkdata.AttackPic, 0, atkdata.AttackPic.Length);
                url            = "data:image/png;base64," + imageurlstring;
                dtAttack.Rows.Add(atkdata.AttackId, atkdata.AttackName, atkdata.AttackInfo, url);
            }
            TypeAtkListView.DataSource = dtAttack;
            TypeAtkListView.DataBind();
        }