首页 > 代码库 > 5555

5555

   1: http://www.sunnychen.org/attachments/month_0905/SyntaxHighlight20090506.zip
using Game.DAL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;


namespace Game.DAL
{
public class DbHelperTest
{
/// <summary>
/// 返回单页数据表 2014/03/11
/// </summary>
/// <param name="table">[NOT NULL]表名</param>
/// <param name="innerjoin">表连接查询</param>
/// <param name="wherestr">条件</param>
/// <param name="rownumberorderby">排序条件,如果为空,只返回总条数totalcount</param>
/// <param name="fielsds">字段列表/列名</param>
/// <param name="pageindex">当前页码</param>
/// <param name="pagesize">每页显示条数</param>
/// <param name="pagecount">总页数</param>
/// <param name="totalcount">总条数</param>
/// <returns></returns>
public static DataTable GetList_Page(string table, string innerjoin, string wherestr, string rownumberorderby, string fielsds, int pageindex, int pagesize, out int pagecount, out int totalcount,string databasename)
{
SqlDataAdapter da = new SqlDataAdapter("USP_CommonPageOne", Conn.GetConn(databasename));
da.SelectCommand.CommandType = CommandType.StoredProcedure;
SqlParameter[] _param = {
new SqlParameter("@TableName",table),
new SqlParameter("@InnerJoin",innerjoin),
new SqlParameter("@WhereStr",wherestr),
new SqlParameter("@RowNumberOrderBy",rownumberorderby),
new SqlParameter("@Fields",fielsds),
new SqlParameter("@PageIndex",pageindex),
new SqlParameter("@PageSize",pagesize),
new SqlParameter("@PageCount",SqlDbType.Int),
new SqlParameter("@RecordCount",SqlDbType.Int)
};
//参数的类型默认是输入参数,所以不指定
_param[7].Direction = ParameterDirection.Output;
_param[8].Direction = ParameterDirection.Output;

da.SelectCommand.Parameters.AddRange(_param);
DataTable dt = new DataTable();
da.Fill(dt);

pagecount = Convert.ToInt32(_param[7].Value);
totalcount = Convert.ToInt32(_param[8].Value);

return dt;
}

/// <summary>
/// 获取玩家的输赢统计
/// </summary>
/// <param name="begintime"></param>
/// <param name="endtime"></param>
/// <param name="orderby"></param>
/// <param name="databasename"></param>
/// <returns></returns>
public static DataTable GetPlayerShuYing(string begintime, string endtime, string orderby, string IsAndroid, int pageindex, int pagesize, out int pagecount, out int totalcount, string databasename)
{
SqlDataAdapter da = new SqlDataAdapter("USP_GrpupByOne", Conn.GetConn(databasename));
da.SelectCommand.CommandType = CommandType.StoredProcedure;
SqlParameter[] _param = {
new SqlParameter("@BeginTime",begintime),
new SqlParameter("@EndTime",endtime),
new SqlParameter("@OrderBy",orderby),
new SqlParameter("@IsAndroid",IsAndroid),
new SqlParameter("@PageIndex",pageindex),
new SqlParameter("@PageSize",pagesize),
new SqlParameter("@PageCount",SqlDbType.Int),
new SqlParameter("@RecordCount",SqlDbType.Int)
};

//参数的类型默认是输入参数,所以不指定
_param[6].Direction = ParameterDirection.Output;
_param[7].Direction = ParameterDirection.Output;

da.SelectCommand.Parameters.AddRange(_param);
DataTable dt = new DataTable();
da.Fill(dt);

pagecount = Convert.ToInt32(_param[6].Value);
totalcount = Convert.ToInt32(_param[7].Value);

return dt;
}
}

}

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Game.Web
{
public partial class AdminTest : System.Web.UI.Page
{
protected void Page_Load( object sender , EventArgs e )
{
HttpCookie cook = HttpContext.Current.Request.Cookies["6603Admin"];
Response.Write( "Name:" + cook.Name );
Response.Write( "<br/>value" + cook.Value );
Response.Write( "<br/>Domain: " + cook.Domain );
Response.Write( "<br/>Path: " + cook.Path );
//Response.Write( "Port: " + cook.Port );
Response.Write( "<br/>Secure: " + cook.Secure );

// Response.Write( "When issued: " + cook.TimeStamp );
Response.Write( "<br/>Expires: " + cook.Expires );
//Response.Write( "Don‘t save: " + cook.Discard );
//Response.Write( "Comment: " + cook.Comment );
//Response.Write( "Uri for comments: " + cook.CommentUri );
//Response.Write( "Version: RFC " + cook.Version );

// Show the string representation of the cookie.
Response.Write( "<br/>String:" + cook.ToString( ) );

}
}
}

 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Game.Web
{
    public partial class AdminTest : System.Web.UI.Page
    {
        protected void Page_Load( object sender , EventArgs e )
        {
            HttpCookie cook = HttpContext.Current.Request.Cookies["6603Admin"];
            Response.Write( "Name:" + cook.Name );
            Response.Write( "<br/>value" + cook.Value );
            Response.Write( "<br/>Domain: " + cook.Domain );
            Response.Write( "<br/>Path: " + cook.Path );
            //Response.Write( "Port: " + cook.Port );
            Response.Write( "<br/>Secure: " + cook.Secure );
           // Response.Write( "When issued: " + cook.TimeStamp );
            Response.Write( "<br/>Expires: " + cook.Expires );
            //Response.Write( "Don‘t save: " + cook.Discard );
            //Response.Write( "Comment: " + cook.Comment );
            //Response.Write( "Uri for comments: " + cook.CommentUri );
            //Response.Write( "Version: RFC " + cook.Version );
            // Show the string representation of the cookie.
            Response.Write( "<br/>String:" + cook.ToString( ) );
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Game.Web
{
    public partial class AdminTest : System.Web.UI.Page
    {
        protected void Page_Load( object sender , EventArgs e )
        {
            HttpCookie cook = HttpContext.Current.Request.Cookies["6603Admin"];
            Response.Write( "Name:" + cook.Name );
            Response.Write( "<br/>value" + cook.Value );
            Response.Write( "<br/>Domain: " + cook.Domain );
            Response.Write( "<br/>Path: " + cook.Path );
            //Response.Write( "Port: " + cook.Port );
            Response.Write( "<br/>Secure: " + cook.Secure );
           // Response.Write( "When issued: " + cook.TimeStamp );
            Response.Write( "<br/>Expires: " + cook.Expires );
            //Response.Write( "Don‘t save: " + cook.Discard );
            //Response.Write( "Comment: " + cook.Comment );
            //Response.Write( "Uri for comments: " + cook.CommentUri );
            //Response.Write( "Version: RFC " + cook.Version );
            // Show the string representation of the cookie.
            Response.Write( "<br/>String:" + cook.ToString( ) );
        }
    }
}

5555