10-19带表情的聊天室
来源:互联网 发布:js冒泡排序算法 编辑:程序博客网 时间:2024/05/23 16:55
login.aspx
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="昵称:"></asp:Label><asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="转入聊天室..." />
</div>
</form>
</body>
login.aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != "")
{
Application["Name"] = TextBox1.Text;
Response.Redirect("聊天.aspx");
}
else
{
Response.Write("昵称不能为空");
}
}
聊天.aspx
<body>
<form id="form1" runat="server">
<div>
<table align="center" >
<tr><td class="style1"> 在线聊天</td></tr>
<tr><td class="style1">
<asp:TextBox ID="txtChatBox" runat="server" Height="114px" TextMode="MultiLine"
Width="260px"></asp:TextBox>
<br />
<br />
<div id="aa" runat="server"></div>
</td>
</tr>
<tr>
<td class="style2"><asp:Label ID="Label1" runat="server" Text="请输入你的信息:"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtMessage" runat="server" Height="44px" TextMode="MultiLine"
Width="176px"></asp:TextBox>
<br />
</td>
</tr>
<tr><td class="style1"><asp:Label ID="Label2" runat="server" Text="选择表情:"></asp:Label></td>
<td><asp:DropDownList ID="DropDownList1" runat="server" Height="20px" Width="63px">
<asp:ListItem>悲伤</asp:ListItem>
<asp:ListItem>高兴</asp:ListItem>
<asp:ListItem>大笑</asp:ListItem>
<asp:ListItem>尴尬</asp:ListItem>
<asp:ListItem>可爱</asp:ListItem>
</asp:DropDownList>
<br />
<br />
</td>
</tr>
<tr><td class="style1">
<asp:Button ID="btnsend" runat="server" Text="发送信息" onclick="btnsend_Click" /> </td><td>
<asp:Button ID="btnclear" runat="server" Text="清除信息" onclick="btnclear_Click" /></td></tr> </table>
</div>
</form>
聊天.aspx.cs
public partial class 聊天 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
this.txtChatBox.Text = Application["ChatLog"].ToString();
}
}
protected void btnsend_Click(object sender, EventArgs e)
{
string a = Application["Name"].ToString();
if (DropDownList1.SelectedValue == "高兴")
{
aa.InnerHtml = a + ":" + this.txtMessage.Text + ":" + "<img src='images/高兴.jpg'>";
}
if (DropDownList1.SelectedValue == "大笑")
{
aa.InnerHtml = a + ":" + this.txtMessage.Text + ":" + "<img src='images/大笑.jpg'>";
}
if (DropDownList1.SelectedValue == "悲伤")
{
aa.InnerHtml = a + ":" + this.txtMessage.Text + ":" + "<img src='images/悲伤.jpg'>";
}
}
protected void btnclear_Click(object sender, EventArgs e)
{
Application["ChatLog"] = "";
txtChatBox.Text = Application["ChatLog"].ToString();
}
}
效果图:
- 10-19带表情的聊天室
- 带表情的评论
- IOS自带表情的使用方法
- 截取带emoji表情的utf8字符串
- EmojiconTextview带表情的输入框
- 申请一个带表情的个性网站
- C# 处理带Emoji表情的的字符串
- Android自带的emoji表情的使用
- Android自带的emoji表情的使用
- Android自带的emoji表情的使用
- 让你的Lable拥有系统自带 表情!
- Android 系统自带输入法的表情显示 -项目总结
- iOS开发,系统自带表情的获取
- Android 系统自带输入法的表情显示 -项目总结
- iOS开发,系统自带表情的获取
- iOS 系统自带的表情输出与获取
- Android 系统自带输入法的表情显示 -项目总结
- 基于可编辑DIV的带表情编辑器
- 解压和生成ramdisk-root.img工具脚本
- 苹果开发者帐号(Company)申请流程
- T_sql之创建数据库
- Android开发调试-static静态变量与如何定义全局变量的问题
- oarcle之with as 构建临时表查询
- 10-19带表情的聊天室
- HSRP协议原理及配置实例
- 升级iOS6系统必备 苹果开发者帐号申请教程
- x86和arm架构原子操作的区别
- Toast自定义和一个textview中显示不同颜色
- JS验证表达函数,可不需要依赖form
- IPhone/IPad的一些使用小技巧
- C++ protected访问标号
- 使用缓存文件存取数据