Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.1
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2004, 11:11 AM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Asp.net 1. 1: How to hide the Password ?

Hi all,
My question is on Username/password authentication
for Web Service on Page 643 ( Beginning ASP.NET 1.1 with VB.NET 2003
). When I try to enter the password ,the whole text appears in the textbox. For example, if the password is "hai" then "hai" appears in the textbox instead of "***". How can I solve this problem
Please help me.

Thank you
 
Old June 10th, 2004, 11:11 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Change the "Textmode" property of password control to password.

Om Prakash
 
Old June 11th, 2004, 02:32 PM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by om_prakash
 Change the "Textmode" property of password control to password.

Om Prakash
Hi Prakash,

I know what u mean. I thought changing the "TextMode " property to "password" is to ".aspx" files. Web services are are ".amsx" files.
I may be wrong.
For example, in Java one can easily use the password mask technoliogy, setEchoChar('*'):
      TextField password = new TextField()
                 password.setEchoChar('*')

I am just wondering if there is this type of technology in VB.
The code is wriiten below, How can U fix the problem? Please help

<%@ WebService Language="vb" Class="ISBN" %>
Imports System.Web.Services
Imports System.Data
Imports System.Data.OleDb


Public Class ISBN
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function BookDetail(ByVal strIsbn As String) As String
      ByVal strUsername As String, _
      ByVal strPassword As String) As String
    Dim SecurityDr As OleDbDataReader
    Dim SecurityConn As OleDbConnection
    Dim SecurityCmd As OleDbCommand

    Dim Conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
        Conn += Server.MapPath("Security.mdb") & ";"
    Dim SQL As String = "select Username from Users where username = '"
        SQL += strUsername & "' and password = '" & strPassword & "'"

    SecurityConn = New OleDbConnection(Conn)
    SecurityCmd = New OleDbCommand(SQL, SecurityConn)
    SecurityConn.Open()

    SecurityDr = _
      SecurityCmd.ExecuteReader(CommandBehavior.CloseCon nection)
    If SecurityDr.Read() Then
      SecurityDr.Close()
      Return GetBookDetails(Isbn)
    Else
      SecurityDr.Close()
      Return "Login to library failed."
    End If
    End Function

    Private Function GetBookDetails(ByVal strIsbn As String) As String
        Dim objLibraryDR As OleDbDataReader
        Dim objLibraryConn As OleDbConnection
        Dim objLibraryCmd As OleDbCommand
        Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Library.mdb") & ";"
        Dim strSQL As String = "select Title from Books where ISBN = '" & strIsbn & "'"
        Dim strBookTitle As String

        objLibraryConn = New OleDbConnection(strConn)
        objLibraryCmd = New OleDbCommand(strSQL, objLibraryConn)
        objLibraryConn.Open()

        objLibraryDR = objLibraryCmd.ExecuteReader(CommandBehavior.CloseC onnection)
        If objLibraryDR.Read() Then
            strBookTitle = objLibraryDR(0)
        Else
            strBookTitle = "Book not found in the database"
        End If
        objLibraryDR.Close()

        Return strBookTitle
    End Function

End Class




 
Old June 11th, 2004, 02:37 PM
Authorized User
 
Join Date: Jun 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by om_prakash
 Change the "Textmode" property of password control to password.

Om Prakash
A standard Web application usually uses Forms security. There is a login page that a user can go to, and once they have enetered a ISERID and Password, they are allowed access to the site. There is no user interface with Web Services, so that option is not available to me either.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Datagrid Autogenaratedcolunm Hide Problem sibajibasak .NET Framework 2.0 3 March 2nd, 2005 10:59 PM
Can'T find code to Beginning Asp.net using VB.NET darruler All Other Wrox Books 1 August 12th, 2004 05:04 PM
Help 'beginning asp.net using vb.net' source code jkmf Wrox Book Feedback 1 January 18th, 2004 08:09 AM
Beginning ASP.Net Databases Using VB.Net ISBN 6195 tlamazares SQL Server ASP 1 December 15th, 2003 01:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.