作者sunny6175 (你好不代表我也好)
站内Web_Design
标题[问题] asp.net
时间Mon Nov 28 23:00:56 2005
我要建立一个聊天室的表单
主要功能都建好了
可是若是要新增一个下拉式选单 ex: zzz"微笑"的说 or "生气"的说
并没办法跑到聊天视窗中
请问我该在我程式中增加哪段
<font size="2" color="#000000">语气:</font>
<asp:DropDownList id="cc" runat="Server">
<asp:ListItem Value="1" Text="高兴"/>
<asp:ListItem Value="2" Text="难过"/>
<asp:ListItem Value="3" Text="生气"/>
<asp:ListItem Value="4" Text="怒气"/>
<asp:ListItem Value="5" Text="想睡"/>
<asp:ListItem Value="6" Text="不舒服"/>
</asp:DropDownList>
</td>
<td width="132" valign="top">
<font size="2" color="#000000">更新频率:</font>
<asp:DropDownList id="Refresh_s" runat="Server">
<asp:ListItem Value="10" Text="10秒"/>
<asp:ListItem Value="20" Text="20秒"/>
<asp:ListItem Value="30" Text="30秒"/>
</asp:DropDownList>
</td>
<td width="132" valign="top">
<font size="2" color="#000000">颜色:</font>
<asp:DropDownList id="f_color" runat="Server">
<asp:ListItem Value="#FF0000" Text="红色"/>
<asp:ListItem Value="#FFFF00" Text="黄色"/>
<asp:ListItem Value="#00FF00" Text="绿色"/>
<asp:ListItem Value="#FFFFFF" Text="白色"/>
<asp:ListItem Value="BLUE" Text="蓝色"/>
<asp:ListItem Value="#FF6633" Text="橘色"/>
</asp:DropDownList>
</td>
<td width="129">
<asp:Button runat="server" Text="送出" OnClick="addmsg_click" />
</td>
</tr>
</table>
</Form>
</body>
</html>
<script language="VB" runat=server>
Sub addmsg_click(sender As Object, e As EventArgs)
Session("RefreshTime") = Refresh_s.SelectedItem.Value
Session("font_color") = f_color.SelectedItem.Value
If Application("ChatUser").ContainsKey ( Session("user_id") ) Then
Dim chat_data As ArrayList
chat_data = Application("ChatUser").Item( Session("user_id") )
Dim path As String = Server.Mappath("talkfile/" & chat_data(0) & ".txt")
Dim sWrite As StreamWriter = New StreamWriter( path, True, Encoding.Default )
Dim S As string
S = "<font size=3 color=" & Session("font_color") & "><small>(" & DateTime.Now & ")</small> " & Session("user_id") & "</small> " & Session("UserSay") & " 说:<font color=" & Session("font_color") & ">" & chatmsg.Text & "</font></font><br>"
chat_data(4) = DateTime.Now()
Application("ChatUser").Item( Session("user_id") ) = chat_data
sWrite.WriteLine( S ) ' 写入档案
sWrite.Flush() ' 将缓冲区写入
sWrite.Close()
chatmsg.Text=""
Else
chatmsg.Text = "请重新登入聊天室"
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 211.74.213.174