Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Please help::Not able to Login using WebRequest/WebResponse

Reply
Thread Tools

Please help::Not able to Login using WebRequest/WebResponse

 
 
=?Utf-8?B?TmFnYQ==?=
Guest
Posts: n/a
 
      06-14-2006
I am using the code below to login to a password requiring website
programatically. I keep getting back the logon page. I have read some posts
here and haven't found a working solution still. I don't need any proxy to
connect. After seeing some posts I eeven added a cookie container, still
doesn't work.I'd really appreciate a lot, if someone could tell me what
additional code is required to make this work
Thanks in advance,
Naga
-************************************************** ***
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create(txtUrl.Text.Trim ());
myRequest.Method = "POST";
myRequest.CookieContainer = new CookieContainer(); // enable cookies

NetworkCredential networkCredential = new NetworkCredential(strName,
strPwd);
// Associate the 'NetworkCredential' object with the 'WebRequest'
object.
myRequest.Credentials = networkCredential;

//System.Net.WebResponse myWebResponse = myRequest.GetResponse();
HttpWebResponse myWebResponse =
(HttpWebResponse)myRequest.GetResponse();
StreamReader sr = new
StreamReader(myWebResponse.GetResponseStream(), Encoding.ASCII);
txtResult.Text = sr.ReadToEnd();
-************************************************** ***
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to display color in excel not able to display color in excel using xml sed_y XML 0 02-15-2012 09:46 PM
Any (preferrably Java) API for screen scraping sites able to login and batch user actions? onetitfemme Java 4 09-08-2006 01:01 AM
Any (preferrably Java) API for screen scraping sites able to login and batch user actions? onetitfemme HTML 4 09-08-2006 01:01 AM
Not able to Login after I visit a page which has been excluded from Forms Authentication. Nitin Verma ASP .Net 1 08-08-2006 09:39 AM
Re: PLEASE? Any way to get the user's nt login from the pc -- not the server login? William F. Robertson, Jr. ASP .Net 0 07-02-2003 03:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57