三层架构+存储过程后台分页+AspNetPager前台分页的经典例子

本文介绍了一个基于三层架构的分页实现示例,利用SQL Server 2005 Rownumber()函数进行高效分页,并结合AspNetPager控件完成前端展示。文中详细解释了存储过程的设计与使用,并提供了DAO、BLL、Model各层的具体实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这是在下经心为初学三层架构的同志打造的例子,一定会对你深入的理解这个架构
有一定的帮助,在这个例子中还用到的分页的存储过程,用的是Sql2005里新加的Rownumber()函数,是最好最简单的分页,加上前台的AspNetPager实现的分页效果,你还等什么来学一下吧,附有源代码可以下载,下载直接要吧运行,
所需的环境:VS2008+sql2005

代码只开放下面的这么多,大家有什么不明白的就留言问我,也可以给我要源代码呵呵

http://d.download.youkuaiyun.com/down/1106433/sufei1013

1.先来看一张实现后的图片吧

这 是实现后的效果,还不错吧,上面的分页效果一定和你想要的差不多吧,怎么实现的呢,来和我一起学习一下吧,

2.首先我们要写一个分页的存储过程

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
USE [base]
GO
/****** 对象:  StoredProcedure [dbo].[sufeiAll]    脚本日期: 03/10/2009 10:03:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sufeiAll]
@startIndex INT--这里是当前的页码
@pageSize INT --这里是分页的大小
AS
with SClass as(     --生成一个新的表,表中的数据是从()里得到的,写起来也方便,只要把想要的写在()里就OK了
select row_number() over(order by userName) as rownumber,--一个新的行是从1到N
userName,pwd,sex,age
from sufei )
/**上半句产生一个临时表,表名为SClass,其内容来自于自查询select row_number().**/
select  userName,pwd,sex,age 
from SClass
where rownumber >=(@startindex-1)*@pagesize+1 and rownumber<=(@startindex-1)*@pagesize+(@pagesize)

select count(*from dbo.sufei--返回所有的行

---在这个存储过程里一共会返回两个表,第一个是所有的数据,第二个是总记录数

点上面的链接要吧查询看存储过程

表非常的简单只有四个字段,全是Varchar(50)

看过了上面的存储过程我们下面要做的就是怎么来用他

3.我们来搭建一个我们的MVc吧,

第一层,DAo层

里面有三个类第一个

首先来看一张图说明一下三层的样子,呵呵

下面我给出三层的代码

EmployeesDao层

1.SqlDBHelper.cs

 

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace EmployeesDao
ExpandedBlockStart.gifContractedBlock.gif
{
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// 功能(Function):存放对数据库的访问方法、变量
    
/// 编写日期 2009-2-21  
    
/// 编写人sufei  
    
/// <summary>
    
/// 访问数据所用的代码,此类为一个抽象的类
    
/// 不能实例化,真接用类名调用即可
    
/// </summary>

    public abstract class SqlDBHelper
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        
//获取数据库连接字符串,其属于静态变量且只读,项目中所有文档可以直接使用,但不能修改
        public static readonly string sufeiConncetin = "Data Source=sufei\\SQLEXPRESS;Initial Catalog=base;Integrated Security=true";

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
///执行一个不需要返回值的SqlCommand命令,通过指定专用的连接字符串。
        
/// 使用参数数组形式提供参数列表 
        
/// </summary>
        
/// <remarks>
        
/// 使用示例:
        
///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
        
/// </remarks>
        
/// <param name="connectionString">一个有效的数据库连接字符串</param>
        
/// <param name="commandType">SqlCommand命令类型 (存储过程, T-SQL语句, 等等。)</param>
        
/// <param name="commandText">存储过程的名字或者 T-SQL 语句</param>
        
/// <param name="commandParameters">以数组形式提供SqlCommand命令中用到的参数列表</param>
        
/// <returns>返回一个数据值表示此SqlCommand命令执行后影响的行数</returns>

        public static int ExecteNonQuery(string conncetionString, CommandType cmdType, string cmdText, params SqlParameter [] commandParameters)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            SqlCommand cmd 
= new SqlCommand();
            
using (SqlConnection conn = new SqlConnection(conncetionString))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
//通过PrePareCommand方法将参数逐个传入到SqlCommand的参数集合中
                PrepareCommand(cmd, conn, null, cmdType, cmdText, commandParameters);
                
int val = cmd.ExecuteNonQuery();
                
//清空SqlCommand中的参数列表
                cmd.Parameters.Clear();
                
return val;
            }
       
        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 执行一条返回结果集的SqlCommand,通过一个已经存在的数据库连接
        
/// 使用参数数组提供参数
        
/// </summary>
        
/// <remarks>
        
/// 使用示例:
        
/// DataTable table=GetTable(conn,CommandType.StoredProcedure,"PublishOrders");
        
/// </remarks>
        
/// <param name="connecttionString">一个现有的数据库连接</param>
        
/// <param name="cmdTye">SqlCommand命令类型</param>
        
/// <param name="cmdText">存储过程的名字或者 T-SQL 语句</param>
        
/// <returns>返回一个表(DataTable)表示查询得到的数据集</returns>

        public static DataTableCollection GetTable(string connecttionString, CommandType cmdTye, string cmdText,params SqlParameter [] commandParameters)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            SqlCommand cmd 
= new SqlCommand();
            DataSet ds 
= new DataSet();
            
using (SqlConnection conn = new SqlConnection(connecttionString))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                PrepareCommand(cmd, conn, 
null, cmdTye, cmdText,commandParameters);
                SqlDataAdapter adapter 
= new SqlDataAdapter();
                adapter.SelectCommand 
= cmd;
                adapter.Fill(ds);
            }

            
//返回一个表集
            return ds.Tables;
        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary>
        
///为执行命令准备参数
        
///</summary>
        
///<param name="cmd">Sqlcommang命令</param>
        
///<param name="conn">已经存在的数据库连接</param>
        
///<param name="trans">数据库事物处理</param>
        
///<param name="cmdType">SqlCommand命令类型(存储过程,T-Sql语句,等等。)</param>
        
///<param name="cmdText">Command text,T-Sql语句,例如:Select * from sufei</param>
        
///<param name="cmdParms">返回带参数的命令</param>

        private static void PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, CommandType cmdType, string cmdText, SqlParameter[] cmdParms)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//判断数据库连接状态
            if (conn.State != ConnectionState.Open)
                conn.Open();

            cmd.Connection 
= conn;
            cmd.CommandText 
= cmdText;
            
//判断是否需要事物处理
            if (trans != null)
                cmd.Transaction 
= trans;

            cmd.CommandType 
= cmdType;

            
if (cmdParms != null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
foreach (SqlParameter parm in cmdParms)
                    cmd.Parameters.Add(parm);
            }

        }

    }

}


2.SqlFiled.cs

 

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

ExpandedBlockStart.gifContractedBlock.gif
/**//// <summary>
///SqlFiled 的摘要说明
/// </summary>

namespace EmployeesDao
ExpandedBlockStart.gifContractedBlock.gif
{
    
public class SqlFiled
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// sufei表用于存放一些测试信息
        
/// </summary>
        
/// <summary>
        
/// sufei
        
/// </summary>

        public static string userName="@userName",pwd="@pwd",sex="@sex",age="@age";

    }

}


3.SqlSTring.cs

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EmployeesDao
ExpandedBlockStart.gifContractedBlock.gif
{
    
public class SqlSTring
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
ContractedSubBlock.gifExpandedSubBlockStart.gif        
//查询所有的Manage#region//查询所有的Manage

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
///删除一个管理员
        
/// </summary>

        public static string selectdelete = @"selectDelete";

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary>
        
///查询所有
        
///</summary>

        public static string sufeiAll = @"sufeiAll";

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary>
        
///添加一个用户
        
///</summary>

        public static string sufeiOneInsert = @"sufei_Insert";

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**////<summary>
        
///根据用户名查询一个用户的详细信息
        
///</summary
        public static string sufeiOneSelectByuserName = @"sufeiOneSelectByuserName";

        
///<summary>
        
///根据用户名修改相应的用户信息
        
///</summary
        public static string sufeiOneUpdateByuserName = @"sufeiOneUpdateByuserName";

        #endregion

    }

}



 

下面是EmployeesModel层

在这里只有一个叫sufei.cs的类是一个实体类,主要是用来传值的

 

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///sufei 的摘要说明
/// </summary>
namespace EmployeesModel
{
   
public  class sufei
    {
        
//封装姓名
        private string userName;

        
public string UserName
        {
            
get { return userName; }
            
set { userName = value; }
        }
        
//封装密码
        private string pwd;

        
public string Pwd
        {
            
get { return pwd; }
            
set { pwd = value; }
        }
        
//封装性
        private string sex;

        
public string Sex
        {
            
get { return sex; }
            
set { sex = value; }
        }
        
//封装年龄
        private string age;

        
public string Age
        {
            
get { return age; }
            
set { age = value; }
        }
    }
}

下面的Bll层这里面写的是所有的访问方法

sufeiServers.cs

 

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using EmployeesDao;
using EmployeesModel;
using System.Data.SqlClient;

namespace EmployeesBLL
ExpandedBlockStart.gifContractedBlock.gif
{
    
public class sufeiServers
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 获取所有管理员(编号,姓名,密码,权限,状态)信息
        
/// </summary>
        
/// <returns>所有管理员(编号,姓名,密码,权限,状态)信息</returns>

        public DataTableCollection GetAllSufei(int startIndex, int pageSize)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//添加两个参数
            SqlParameter[] parms = new SqlParameter[] 
ExpandedSubBlockStart.gifContractedSubBlock.gif            

                 
new SqlParameter("@startIndex" ,SqlDbType.Int),
                 
new SqlParameter("@pageSize",SqlDbType.Int)
            }
;
            
//给参赋值
            parms[0].Value = startIndex;
            parms[
1].Value = pageSize;
            DataTableCollection table 
= SqlDBHelper.GetTable(SqlDBHelper.sufeiConncetin, CommandType.StoredProcedure, SqlSTring.sufeiAll,parms);
            
return table;
        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 根据用户的用户名删除用户的信息
        
/// </summary>
        
/// <returns>如果返回为true删除成功,如果返回为false删除失败</returns>

        public Boolean DeleteOneSufei(sufei objsufei)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//添加一个参数
            SqlParameter[] parms = new SqlParameter[] 
ExpandedSubBlockStart.gifContractedSubBlock.gif            

                
new SqlParameter(SqlFiled.userName ,SqlDbType.VarChar,11)
            }
;
            
//给参赋值
            parms[0].Value = objsufei.UserName;
            
int result = SqlDBHelper.ExecteNonQuery(SqlDBHelper.sufeiConncetin, CommandType.StoredProcedure, SqlSTring.selectdelete, parms);
            
if (result > 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return true;
            }

            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return false;
            }

        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 插入一条数据
        
/// </summary>
        
/// <returns>如果返回为true添加成功,如果返回为false添加失败</returns>

        public Boolean InserSufei(sufei objsufei)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//添加四个参数
            SqlParameter[] parms = new SqlParameter[]
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
new SqlParameter (SqlFiled .userName ,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .pwd ,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .sex ,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .age ,SqlDbType .VarChar ,50)
            }
;
            parms[
0].Value = objsufei .UserName;
            parms[
1].Value = objsufei .Pwd ;
            parms[
2].Value = objsufei .Sex ;
            parms[
3].Value = objsufei .Age ;
            
int result = SqlDBHelper.ExecteNonQuery(SqlDBHelper.sufeiConncetin, CommandType.StoredProcedure, SqlSTring.sufeiOneInsert, parms);
            
if (result > 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return true;
            }

            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return false;
            }

        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 查询一条数据
        
/// </summary>
        
/// <returns>返回一个DataTable代表的是数据的集合</returns>

        public DataTable sufeiOneSelect(sufei objsufei)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            SqlParameter[] parms 
= new SqlParameter[]
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
new SqlParameter (SqlFiled .userName ,SqlDbType .VarChar ,50)
            }
;
            parms[
0].Value = objsufei.UserName;

            DataTable objdable 
= SqlDBHelper.GetTable(SqlDBHelper.sufeiConncetin, CommandType.StoredProcedure, SqlSTring.sufeiOneSelectByuserName, parms)[0];
            
return objdable;
        }


ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//// <summary>
        
/// 更新一条数据
        
/// </summary>
        
/// <returns>如果返回为true修改成功,如果返回为false修改失败</returns>

        public Boolean sufeiOneUpdate(sufei objsufei)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            SqlParameter[] parms 
= new SqlParameter[]
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
new SqlParameter(SqlFiled .userName ,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .pwd ,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .sex,SqlDbType .VarChar ,50),
                
new SqlParameter (SqlFiled .age ,SqlDbType .VarChar ,50)
            }
;
            parms[
0].Value = objsufei.UserName;
            parms[
1].Value = objsufei.Pwd;
            parms[
2].Value = objsufei.Sex;
            parms[
3].Value = objsufei.Age;
            
int result = SqlDBHelper.ExecteNonQuery(SqlDBHelper.sufeiConncetin, CommandType.StoredProcedure, SqlSTring.sufeiOneUpdateByuserName, parms);
            
if (result > 0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return true;
            }

            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                
return false;
            }

        }


    }

}


这里给出 是的一个前台的界面,有助于大家的学习

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EmployeesBLL;
using EmployeesModel;

public partial class _Default : System.Web.UI.Page
ExpandedBlockStart.gifContractedBlock.gif
{
ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//// 编写日期 2009-2-21  
    
/// 编写人sufei  
    
/// <summary>
    
/// 前台界面实现对表的增删改查操作
    
/// </summary>


    
//产生一个类的对象,用于完成对sufei表的管理
    sufeiServers objManageServers = new sufeiServers();
    
//定义一人静态的表用于存放数据
    private static DataTable dt_Sufei = new DataTable();
    
//用于刷新数据的方法

    
private void BinderDataGriedView()
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        
try
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            dt_Sufei 
= objManageServers.GetAllSufei(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize)[0];
            AspNetPager1.RecordCount 
= Convert.ToInt32(objManageServers.GetAllSufei(AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize)[1].Rows[0][0].ToString().Trim());
            
//把数据库中的数据英文字段中文化
            dt_Sufei.Columns[0].ColumnName = "用户名";
            dt_Sufei.Columns[
1].ColumnName = "密码";
            dt_Sufei.Columns[
2].ColumnName = "性别";
            dt_Sufei.Columns[
3].ColumnName = "年龄";
            gvSufei.DataSource 
= dt_Sufei;
            gvSufei.DataBind();
        }

        
catch (Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            lblMessage.Visible 
= true;
            lblMessage.Text 
= ex.Message.ToString().Trim();
        }

    }


    
//加载时执行
    protected void Page_Load(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        
try
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//非首次加载不执行
            if (!IsPostBack)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                BinderDataGriedView();
            }

        }

        
catch (Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            lblMessage.Visible 
= true;
            lblMessage.Text 
= ex.Message.ToString().Trim();
        }

    }


    
//删除一个数据
    protected void gvSufei_RowDeleting(object sender, GridViewDeleteEventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        
try
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//调用ManageServers类的DeleteOneManager方法用于删除一个数据
            
//产生一个实体的对象
            sufei objsufei = new sufei();
            objsufei.UserName 
= gvSufei.Rows[e.RowIndex].Cells[2].Text.ToString().Trim();
            
if (objManageServers.DeleteOneSufei(objsufei))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                lblMessage.Visible 
= true;
                lblMessage.Text 
= "删除成功";
            }

            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                lblMessage.Visible 
= true;
                lblMessage.Text 
= "删除失败";
            }

            
//刷新数据
            BinderDataGriedView();
        }

        
catch (Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            lblMessage.Visible 
= true;
            lblMessage.Text 
= ex.Message.ToString().Trim();
        }

    }


    
//添加
    protected void btnEnter_Click(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        
try
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            
//产生一个实体的对角
            sufei objsufei = new sufei();
            objsufei .UserName
=txtUserName.Text.ToString().Trim();
            objsufei .Pwd 
=txtUserPwd.Text.ToString().Trim();
            objsufei .Sex 
= txtSex.Text.ToString().Trim();
            objsufei .Age 
= txtAge.Text.ToString().Trim();
            
//在这里是把上面的数据封装成一个对象
             
//调用ManageServers类的方法InsertSufei用于添加一个数据
            if (objManageServers.InserSufei(objsufei))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                lblMessage.Visible 
= true;
                lblMessage.Text 
= "添加成功";
            }

            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
{
                lblMessage.Visible 
= true;
                lblMessage.Text 
= "添加失败";
            }

            
//刷新数据
            BinderDataGriedView();
        }

        
catch (Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
{
            lblMessage.Visible 
= true;
            lblMessage.Text 
= ex.Message.ToString().Trim();
        }

    }


    
//转到修改界面
    protected void gvSufei_SelectedIndexChanged(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        Response.Redirect(
"sufeiUpdate.aspx?username=" + gvSufei.SelectedRow.Cells[2].Text.ToString().Trim());
    }


    
//分页时执行
    protected void AspNetPager1_PageChanged1(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
{
        BinderDataGriedView();
    }

}


代码就开放过么多,大家有什么不明白的就留言问我,也可以给我要源代码呵呵

http://files.cnblogs.com/sufei/AspNetPager.rar

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值