Monday, February 1, 2010

zhuce.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class zhuce : System.Web.UI.Page
{

SqlConnection connecotion = new SqlConnection("Data Source=.;Initial Catalog=liaotian;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{ IRCModel._IRCModel addallUser = new IRCModel._IRCModel();
IRCBLL._IRCBLL addoneUser = new IRCBLL._IRCBLL();

int z = 0;
addallUser.ID = TextBox1.Text;
addallUser.Pwd = TextBox2.Text;
addallUser.Name = TextBox3.Text;
addallUser.Online =Convert.ToString(z);//5%1%a%s%p%x
if (addoneUser.into(addallUser))
{
Label5.Visible =false;
Response.Redirect("denglu.aspx");
}
else
{
Label5.Visible=true;

}

}
}

MsgContent.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text=Convert.ToString( Application["jilu"]);
}
}

denglu.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

//源码下载 www.51aspx.com
public partial class denglu : System.Web.UI.Page
{
IRCModel._IRCModel allUsers = new IRCModel._IRCModel();
IRCBLL._IRCBLL oneUsers = new IRCBLL._IRCBLL();
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
Label3.Visible = false;
Label4.Visible = false;
allUsers.ID = TextBox1.Text;
oneUsers.Log(allUsers);
try
{
Session["ID"] = Convert.ToString(oneUsers.Log(allUsers).Tables[0].Rows[0][0]);
}
catch
{
Label3.Visible = true;

}
allUsers.ID = Convert.ToString(Session["ID"]);

try
{
Session["name"] = Convert.ToString(oneUsers.Log(allUsers).Tables[0].Rows[0][2]);

}
catch
{
Label3.Visible = true;
}
allUsers.Pwd = TextBox2.Text;
if (oneUsers.password(allUsers))
{
allUsers.ID = TextBox1.Text;
if (oneUsers.update1(allUsers))
{
Application.Set("jilu", Application["jilu"] + "
" + "欢迎" + Convert.ToString(Session["name"]) + "进入聊天室");
Response.Redirect("Default.aspx");
}


else
{
Label4.Visible = true;
}



}
}
}

Default.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection connecotion = new SqlConnection("Data Source=.;Initial Catalog=liaotian;Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Timer1_Tick(object sender, EventArgs e)
{
connecotion.Open();
SqlDataAdapter Adapter = new SqlDataAdapter("select * from yonghu where zaixian='1'", connecotion);
DataSet set = new DataSet();
Adapter.Fill(set);
ListBox1.DataSource = set;
ListBox1.DataTextField = "name";//5~1-a-s-p-x
ListBox1.DataValueField = "name";
ListBox1.DataBind();

}
protected void Button1_Click(object sender, EventArgs e)
{
Application.Set("jilu",Application["jilu"] + "
" + Convert.ToString(Session["name"]) + "说:" + TextBox2.Text);
TextBox2.Text = "";
}

}

AJAXEnabledWebSite2.sln

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "E:\...\AJAXEnabledWebSite2\", ".", "{5A29974E-5E8F-427D-852B-21F4E65F2F86}"
ProjectSection(WebsiteProperties) = preProject
Debug.AspNetCompiler.VirtualPath = "/AJAXEnabledWebSite2"
Debug.AspNetCompiler.PhysicalPath = "E:\项目\未分类\聊天室\AJAXEnabledWebSite2\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\AJAXEnabledWebSite2\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/AJAXEnabledWebSite2"
Release.AspNetCompiler.PhysicalPath = "E:\项目\未分类\聊天室\AJAXEnabledWebSite2\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\AJAXEnabledWebSite2\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "13495"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug.NET = Debug.NET
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5A29974E-5E8F-427D-852B-21F4E65F2F86}.Debug.NET.ActiveCfg = Debug.NET
{5A29974E-5E8F-427D-852B-21F4E65F2F86}.Debug.NET.Build.0 = Debug.NET
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal