Capture user credentials

Posted on 2006-03-27
Last Modified: 2006-11-18
I have a VB.NET console app that will run nightly via scheduler.  Also, this exe can be initiated by a small little ASP.NET web form I created that simply has a button that fires off the exe located on our server using some code I created in my aspx.vb file using the System.Diagnostics.Process namespace

How can I capture:

1) The UserID that is set in my sheduler who runs the exe every night via the scheduled task

2) The user who clicks on my button

I need to insert this information into a trail table so I need to know how to grab this info in both cases in VB.NET v2.0 specifically...please no VB.NET v1.0 or 1.1 here.
Question by:dba123
    LVL 15

    Accepted Solution

    does your site use authentication? if not then it will not be possible to capture the user as they will all be using anonymous access. If they are on a domain or logged in then something like HttpContext.Current.User.Identity.Name would get their username.
    LVL 3

    Assisted Solution

    There are probably several possiblities for you

    I personnally add the user name in a session from the login control

    Session.Add("UserName", Login1.UserName)

    this is supposed to retrieve the user name as well, you could store it in any number of ways.  this will save it as a string

    dim strUserName as String = User.Identity.Name

    this forum relates to your question about the user id

    LVL 3

    Expert Comment

    have you solved your problem?
    LVL 1

    Author Comment

    Thanks, this is a start.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    I have developed many web applications with asp & and to add and use a dropdownlist was always a very simple task, but with the new, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now