Re: How to implement a automatic login function
- From: "RobGMiller" <RobGMiller@xxxxxxxxx>
- Date: 5 Apr 2007 22:04:44 -0700
On Apr 5, 9:27 pm, stch...@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
wrote:
Hi Rob,
Thanks for your input.
I think what you want to do is a bit different. What you want to do is like
a web client which programmatically send http post request to send login
credentials and pass the login page at server-side, just like many web
crawler does, correct?
For programmatically post http form data (through webrequest component in
.net), here are some useful web links:
#ASP.NET: Post Data Programmatically with "Webscraping"http://www.developer.com/net/asp/article.php/3645506
#Programmatically Posting Data to ASP .NET Web Applicationshttp://dndj.sys-con.com/read/45127.htm
#Https form post using Httpwebrequest brings back the same page.http://www.thescripts.com/forum/thread591965.html
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for the reply Steven,
Unfortunately, this is not what I am after.
I am simply trying to simulate a normal login. At the moment the site
uses the login control connected to the Membership class. Under a
normal login the CurrentUser is associated with the current session
and can be picked up on any page by Membership.GetUser(). As per your
suggestion earlier in this thread I've been able to pass in the
username and password via a post and authenticate using the
following.
If Membership.ValidateUser(UserName, Password) Then
FormsAuthentication.RedirectFromLoginPage(UserName, True)
At least I think it authenticates because no error is returned but I
can't really know for sure because I can pickup up the current user
name in the normal way as follows:
Dim CurrentUser As MembershipUser = Membership.GetUser()
Message.Text = "Login Successfull. User = " & CurrentUser.UserName
In this case Membership.GetUser() returns a null.
Regards,
RobGMiller
.
- References:
- How to implement a automatic login function
- From: Victor
- Re: How to implement a automatic login function
- From: RobGMiller
- Re: How to implement a automatic login function
- From: Steven Cheng[MSFT]
- How to implement a automatic login function
- Prev by Date: Encrypting/Decrypting XML Documents with Asymmetric Keys
- Next by Date: ASP.NET 2.0 FileUpload - Is it possible to set wildcards?
- Previous by thread: Re: How to implement a automatic login function
- Next by thread: Re: How to implement a automatic login function
- Index(es):
Relevant Pages
|