We help IT Professionals succeed at work.

Capture user credentials

dba123 asked
Medium Priority
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.
Watch Question

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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
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


have you solved your problem?


Thanks, this is a start.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.