00001: <%@ Page Language="VB" MasterPageFile="~/M1.master" AutoEventWireup="false" CodeFile="ActivateLogin.aspx.vb" Inherits="ActivateLogin" %> 00002: <%@ MasterType VirtualPath="~/M1.master" %> 00003: <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 00004: <asp:Literal ID="Literal1" runat="server"></asp:Literal> 00005: <br /> 00006: <asp:Button ID="Button1" runat="server" Text="Войти" /> 00007: </asp:Content> ..... 00001: 00002: Partial Class ActivateLogin 00003: Inherits System.Web.UI.Page 00004: 00005: Protected Sub ActivateLogin_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 00006: If Not IsPostBack Then 00007: If Context.Request.QueryString("i") <> "" And Context.Request.QueryString("j") <> "" Then 00008: Dim UserID As Guid 00009: Dim ActivateID As Guid 00010: Try 00011: UserID = New Guid(Context.Request.QueryString("i")) 00012: ActivateID = New Guid(Context.Request.QueryString("j")) 00013: Catch ex As Exception 00014: Throw New Exception("Нет, так не получится (0).") 00015: End Try 00016: Dim User1 As MembershipUser = Membership.GetUser(UserID) 00017: If User1 IsNot Nothing Then 00018: Dim MyTypedProfile As ProfileCommon = ProfileBase.Create(User1.UserName) 00019: If MyTypedProfile IsNot Nothing Then 00020: Dim SavedGuid As String = MyTypedProfile.LoginActivateGUID 00021: If SavedGuid = Context.Request.QueryString("j") Then 00022: MyTypedProfile.LoginIsActivate = True 00023: MyTypedProfile.Save() 00024: Literal1.Text = "Спасибо. Вы активированы на сайте VOTPUSK.RU" 00025: Else 00026: Literal1.Text = "Нет, так не получится (1)." 00027: End If 00028: Else 00029: Literal1.Text = "Нет, так не получится (2)." 00030: End If 00031: Else 00032: Literal1.Text = "Нет, так не получится (3)." 00033: End If 00034: Else 00035: Literal1.Text = "Нет, так не получится (4)." 00036: End If 00037: End If 00038: End Sub 00039: 00040: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 00041: Response.Redirect("~/login.aspx") 00042: End Sub 00043: 00044: End Class
Comments (
)
Link to this page:
//www.vb-net.com/asp2/35/10.htm
|