jianinclude.ascx.cs
资源名称:论坛源码.rar [点击查看]
上传用户:scene123
上传日期:2010-02-19
资源大小:3311k
文件大小:2k
源码类别:
.net编程
开发平台:
C#
- namespace kuangren
- {
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using System.Data.OleDb;
- using System.Configuration;
- using System.Text;
- using System.Web.Security;
- using System.Security.Cryptography;
- /// <summary>
- /// jianinclude 的摘要说明。
- /// </summary>
- public class jianinclude : System.Web.UI.UserControl
- {
- protected System.Data.OleDb.OleDbCommand cmd;
- protected System.Data.OleDb.OleDbConnection conn;
- public DataSet dsuser;
- public string messagejudge;
- public string soundjudge;
- public int countnews;
- private void Page_Load(object sender, System.EventArgs e)
- {
- if (Request.Cookies["jusername"]!=null)
- {
- conn = new OleDbConnection(ConfigurationSettings.AppSettings["cnFriends.ConnectionString"]);
- cmd=new OleDbCommand("select p_id from forum_5 where p_take='"+Request.Cookies["jusername"].Value+"'and p_yn=0",conn);
- OleDbCommand cmd6 = new OleDbCommand("select count(p_id) from forum_5 where p_take='"+Request.Cookies["jusername"].Value+"'and p_yn=0",conn);
- dsuser=new DataSet();
- cmd.Connection.Open();
- countnews=(int)cmd6.ExecuteScalar();
- OleDbDataReader objDataReader ;
- objDataReader = cmd.ExecuteReader();
- if (objDataReader.Read() == true)
- {
- messagejudge="<img src=skin/dvbbs/images/msg_box.gif border=0> <a href=user_board_message.aspx><font color=red>您的收件箱中有新的短消息<b>( "+countnews+" )</b>封</font></a>";
- soundjudge="<bgsound src=Style/mail.wav border=0>";
- }
- else
- {
- messagejudge="<img src=skin/dvbbs/images/msg_box.gif border=0> <a href=user_board_message.aspx><font color=#999999>您的收件箱中没有新的短消息</font></a>";
- }
- dsuser.Clear();
- conn.Close();
- }
- }
- #region Web 窗体设计器生成的代码
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器
- /// 修改此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- }
- }