当我使用默认的ASP.NET 2.0中的会员管理,当你需要添加某些字段例如增加用户生日,我们可以使用profile来实现此类的功能,profile适合于存储少量的用户数据,用户数据存在数据库中。
使用方法:
在WEB.Confi中添加
<profile>
<properties>
<add
name="RenWuPiShu" type="String" /> //添加的profile字段
</properties>
</profile>
然后只要通过程序给他赋值就可以了
如
protected void Button1_Click(object sender, EventArgs e)
{
this.Profile.RenWuPiShu = TextBox1.Text;
}
调用方式就是
this.Profile.RenWuPiShu就可以了
浙公网安备 33010602011771号