hi all!!
wonder why my class doesn't store the values???
the class
the login:Code:Imports Microsoft.VisualBasic Public Class Strings Private _user As String = "" Property User() As String Get Return _user End Get Set(ByVal value As String) _user = value End Set End Property End Class
Code:Sub dologin(ByVal Source As Object, ByVal E As EventArgs) Dim strConn As String = (ConfigurationManager.ConnectionStrings _ ("GesQualConnectionString").ConnectionString) Dim MySQL As String = "Select ID, Utilizador , Pass ," & _ "AlterarPass from Users Where Utilizador = '" & _ TxtUser.Text & "' and Pass = '" & Uteis.GeraHash(TxtPass.Text) & "'" Dim MyConn As New SqlConnection(strConn) Dim Cmd As New SqlCommand(MySQL, MyConn) MyConn.Open() objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection) If Not objDR.Read() Then LblResposta.Text = "<h1><b>User / Pass Inválidos !</b></h1></p>" While objDR.Read() strNome = objDR("Utilizador") intCode = objDR("ID") bprimeirologin = objDR("AlterarPass") End While Session("ID") = intCode Session("Utilizador") = strNome Dim clsStrings As New Strings clsStrings.User = strNome objDR.Close() MyConn.Close() Else objDR.Close() MyConn.Open() If bprimeirologin Then Response.Redirect("~\MudaPass.aspx") Else Response.Redirect("~\Default.aspx") End If End If End Sub
and the call:
Code:Protected Sub Page_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Load Dim ClsStrings As New Strings Label1.Text = ClsStrings.User End Sub




Reply With Quote