<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
If Dvbbs.UserID>0 Then
	Dim TruePassWord,usercookies
	usercookies=Request.Cookies(Dvbbs.Forum_sn)("usercookies")
	TruePassWord=Dvbbs.Createpass
	If (Isnull(usercookies) or usercookies="") And Not Isnumeric(usercookies) Then usercookies=0
	Select Case Cint(usercookies)
		Case 0
			Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
		Case 1
			Response.Cookies(Dvbbs.Forum_sn).Expires=Date+1
			Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
		Case 2
			Response.Cookies(Dvbbs.Forum_sn).Expires=Date+31
			Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
		Case 3
			Response.Cookies(Dvbbs.Forum_sn).Expires=Date+365
			Response.Cookies(Dvbbs.Forum_sn)("usercookies") = usercookies
	End Select
	Response.Cookies(Dvbbs.Forum_sn).path=Dvbbs.cookiepath
	Response.Cookies(Dvbbs.Forum_sn)("username") = Dvbbs.MemberName
	Response.Cookies(Dvbbs.Forum_sn)("UserID") = Dvbbs.UserID
	Response.Cookies(Dvbbs.Forum_sn)("userclass") = Dvbbs.checkStr(Request.Cookies(Dvbbs.Forum_sn)("userclass"))
	Response.Cookies(Dvbbs.Forum_sn)("userhidden") = Dvbbs.UserHidden
	Response.Cookies(Dvbbs.Forum_sn)("password") = TruePassWord
	'检查写入是否成功如果成功则更新数据
	If Dvbbs.checkStr(Trim(Request.Cookies(Dvbbs.Forum_sn)("password")))=TruePassWord Then
		Dvbbs.Execute("UpDate [Dv_user] Set TruePassWord='"&TruePassWord&"' where UserID="&Dvbbs.UserID)
		Dvbbs.MemberWord = TruePassWord
		Dim iUserInfo
		iUserInfo = Session(Dvbbs.CacheName & "UserID")
		iUserInfo(35) = TruePassWord
		Session(Dvbbs.CacheName & "UserID") = iUserInfo
	End If
End If
Dim ComeUrl
ComeUrl=Session("LoadCache")
If ComeUrl<>"" Then
	Session("LoadCache")=""
	Response.Redirect ComeUrl
End If
%>