Capture user credentials

Posted on 2006-03-27
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.
Question by:dba123
  • 2
LVL 15

Accepted Solution

Solar_Flare earned 1200 total points
ID: 16304626
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.

Assisted Solution

ptleitch earned 800 total points
ID: 16305031
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



Expert Comment

ID: 16307100
have you solved your problem?

Author Comment

ID: 16357595
Thanks, this is a start.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 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