一、方法
在网站中,类一定要放在App_Code文件夹,所以要在新建一个App_Code文件夹,然后添加 添加新项 选择类模板(Account.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Account 的摘要说明
/// </summary>
public class Account
{
private string _ID;
private string _Name;
private decimal _Balance;
public string ID
{
get {
return _ID; }
set {
_ID = value; }
}
public string Name
{
get {
return _Name; }
set {
_Name = value; }
}
public decimal Balance
{
get {
return _Balance; }
set {
_Balance = value; }
}
public Account()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public Account(string id,string name,decimal balance)
{