Results 1 to 3 of 3

Thread: detecting username

Hybrid View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    detecting username

    hi

    is there a way in vb.net to detect the username that is accessing the database? or really, is there a way to detect what the current username is of the person that is accessing a webpage?

    i basically have a website, and has a form etc... and people log in (automatically from their machine or supplied un/pw) and i want some of the field elements to be populated automatically depending on the username

    any ideas?

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    I take it we're talking asp.net here....

    What method are you using for your users to logon?

    Are you using one of the built in methods such as formsauthentication / windows authentication?
    If so you can store the username when they login and retrieve it using something like
    VB Code:
    1. formsAuthentication.user.id
    It's prob nothing like that buti can't check right now.

    Otherwise just store the username in a session variable after the user logs in.

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    just remembered it's more like
    VB Code:
    1. formsAuthentication.user.identity
    I'd recommend using built in secruity if you're not already.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width