1.登陆验证代码
2.注册代码(通过profile扩展)
对应的web.config中profile节点的配置如下;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
profile
enabled
="true"
defaultProvider
="profileSqlMembershipProvider"
>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
providers
>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
add
name
="profileSqlMembershipProvider"
type
="System.Web.Profile.SqlProfileProvider"
connectionStringName
="webshopConnectionString"
/>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
</
providers
>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
properties
>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
add
name
="telphone"
type
="String"
/>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
add
name
="QQ"
type
="String"
/>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
<
add
name
="address"
type
="String"
/>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
</
properties
>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
</
profile
>
4.验证用户名是否存在代码
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
MembershipUserCollection col
=
Membership.FindUsersByName(
this
.TextBox1.Text);
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
if
(col.Count
==
0
)
Label1.Text
=
"
恭喜您,可以注册
"
;
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
else
Label1.Text
=
"
此用户已存在
"
;
5.判断用户是否登陆或者匿名代码
6.获取当前用户名