Link to home
Start Free TrialLog in
Avatar of JB4375
JB4375Flag for United States of America

asked on

VB Script Method to Capture Authenticated User

I have a VB.Net subroutine that I run on load to capture the user ID of the authenticated user. I use the variable, for example, to notify the user via email of the results. How would I do this in vbscript. Below is the code.

Thanks!
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblResults.Visible = False
        imgCheckMark.Visible = False
        imgRedX.Visible = False
        strDate = Now
        strUser = (Request.ServerVariables("AUTH_USER"))
 
        If InStr(strUser, "Domain\") Then
            strUser = Replace(strUser, "Domain\", "")
        End If
 
        If InStr(strUser, "Domain\") Then
            strUser = Replace(strUser, "Domain\", "")
        End If
        Label28.Text = strUser
    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Hubasan
Hubasan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JB4375

ASKER

That works. Thanks!