Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Can anyone tell me how to get the e-mail address of a user accessing my web page?

 

I know this has been answered a million times but I could not find the answer...

 

Thanks in advance

when the day is bad and life's a curse, cheer up tomorrow may be worse.
Posted
You can't get the email of the person visiting your web page, I wouldn't like this, MY PRIVACY IS WORTH SOMETHING, every spammer in the world thought of this idea, but thank God you can't, the only thing that at this time comes to my mind is that you can get the IP of the user, knowing that in this IP 200 other guys or more may be using it too (proxy or firewall).
Fat kids are harder to kidnap
Posted

Actually, I dug it up. Thanks for the help. I can provide what I found to anyone who is interested. It isn't pretty but it gives me enough of what I need.

 

For the record, I am not a spammer.

 

Samsmithnz - I agree that an extra login would be the right thing but it was something my user was adament against (another password/login to keep track of.)

when the day is bad and life's a curse, cheer up tomorrow may be worse.
Posted

It is not pretty, but it all I need. I have 2 sets of code that work...

 

Imports System.Web.Security

 

Then code something like this:

Sub GetUserID()

Dim userID As String

Dim strFullName As String

strFullName = User.Identity.Name

 

'GET JUST THE LOGIN ID(REMOVE ANY DOMAIN INFO)

userID = strFullName.Substring(strFullName.IndexOf("\", 0) + 1)

 

textBox1.text = userID

End Sub

****************

 

 

Dim user As String = Request.ServerVariables("LOGON_USER")

If Len((user)) + 1 = 1 Then

Response.Status = "401 unathorized"

Response.AddHeader("WWW-Authenticate", "BASIC REALM=You are not authorized to access this resource.")

Dim akey As String

Response.Write("<h2>All Server Variables</h2>")

For Each akey In Request.ServerVariables.Keys

Response.Write(akey & "=" & Request.ServerVariables.Item(akey) & "<br>")

Next

Response.End()

Else

Dim s As String

s = "LOGON_USER=" & Request.ServerVariables("LOGON_USER") & "<br>"

s += "AUTH_USER=" & Request.ServerVariables("AUTH_USER") & "<br>"

s += "AUTH_PASSWORD=" & Request.ServerVariables("AUTH_PASSWORD") & "<br>"

Me.lblresult.Text = s

End If

when the day is bad and life's a curse, cheer up tomorrow may be worse.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...