adduser_havier.aspx.cs
资源名称:论坛源码.rar [点击查看]
上传用户:scene123
上传日期:2010-02-19
资源大小:3311k
文件大小:2k
源码类别:
.net编程
开发平台:
C#
- 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.IO;
- namespace kuangren
- {
- /// <summary>
- /// adduser_havier 的摘要说明。
- /// </summary>
- public class adduser_havier : System.Web.UI.Page
- {
- protected int intRunTime;
- protected DateTime dtStartTime = DateTime.Now;
- public DataSet dsPending1;
- public string sql1;
- public string newuser;
- public int showpower;
- private void Page_Load(object sender, System.EventArgs e)
- {
- //定义会员数
- OleDbConnection cnn = new OleDbConnection(ConfigurationSettings.AppSettings["cnFriends.ConnectionString"]);
- OleDbCommand cmd4 = new OleDbCommand("select count(u_id) from userinfo",cnn);
- cnn.Open();
- showpower=(int)cmd4.ExecuteScalar();
- cnn.Close();
- //结束
- //定义最新会员
- sql1="select u_user from userinfo order by u_id desc";
- dsPending1=new DataSet();
- OleDbDataAdapter adWord1=new OleDbDataAdapter(sql1,cnn);
- adWord1.Fill(dsPending1,"userinfo");
- Page.DataBind();
- newuser=Convert.ToString(dsPending1.Tables[0].Rows[0]["u_user"]);
- //结束
- using (StreamWriter sw = new StreamWriter(Server.MapPath("Writerfile2.aspx"),false,System.Text.Encoding.GetEncoding("gb2312")))
- {
- // Add some text to the file.
- sw.Write("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
- sw.WriteLine("<tr> ");
- sw.Write("<td width='50%'>共有<strong>"+showpower+"</strong>位会员</td>");
- sw.Write("<td width='50%'>新进来宾 <a href='user_infor.aspx?u_user="+newuser+"' target=_blank><b>"+newuser+"</b></a></td>");
- sw.Write("</tr>");
- sw.Write("</table>");
- sw.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
- }
- }