"System.Web.UI.WebControls.TextBox"不包含"DataSource"的定义
,并且找不到可接受类型为"System.Web.UI.WebControls.TextBox"usingSystem;usingSystem.Collections;us...
,并且找不到可接受类型为"System.Web.UI.WebControls.TextBox"
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class chat : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Application.Lock();
string[] messages = Application["chats"].ToString().Split(',');//把Application里的聊天记录拿出来,用,号分隔成数组
for (int i = 0; i <= messages.Length - 1; i++)
{
contentTextBox.Text += messages[i] + "\n";
}
int current = Convert.ToInt32(Application["current"]);
ArrayList ItemList = new ArrayList();
string zs_name; //已在线的用户名
string[] user; //在线用户的数组
int num = Convert.ToInt32(Application["userNum"]);
zs_name = Application["user"].ToString();
user = zs_name.Split(',');
for (int i = (num - 1); i >= 0; i--)
{
if (user[i].ToString() != "")
ItemList.Add(user[i].ToString());
}
ListBox1.DataSource = ItemList;
ListBox1.DataBind();
Application.UnLock();
} 展开
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class chat : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Application.Lock();
string[] messages = Application["chats"].ToString().Split(',');//把Application里的聊天记录拿出来,用,号分隔成数组
for (int i = 0; i <= messages.Length - 1; i++)
{
contentTextBox.Text += messages[i] + "\n";
}
int current = Convert.ToInt32(Application["current"]);
ArrayList ItemList = new ArrayList();
string zs_name; //已在线的用户名
string[] user; //在线用户的数组
int num = Convert.ToInt32(Application["userNum"]);
zs_name = Application["user"].ToString();
user = zs_name.Split(',');
for (int i = (num - 1); i >= 0; i--)
{
if (user[i].ToString() != "")
ItemList.Add(user[i].ToString());
}
ListBox1.DataSource = ItemList;
ListBox1.DataBind();
Application.UnLock();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询