Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 6th, 2003, 10:03 AM
Registered User
 
Join Date: Jun 2003
Location: Sloatsburg, NY, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logging into other sites

I would like to know if it is possible to have a web page that goes out and logs into other web sites and gathers all the information on those sites.
  #2 (permalink)  
Old June 6th, 2003, 11:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Yes, it is possible - you can use Microsoft.XMLHTTP component to send a request to some page, and to get the response from it.
If you need some code, let us know...


...but the Soon is eclipsed by the Moon
  #3 (permalink)  
Old June 6th, 2003, 12:07 PM
Registered User
 
Join Date: Jun 2003
Location: Sloatsburg, NY, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would like a code example. An example of getting a username and password from a user and using it to log into another site, then getting all the users info to be used on my site.

Thanks,
Jon
  #4 (permalink)  
Old June 6th, 2003, 12:10 PM
Registered User
 
Join Date: Jun 2003
Location: Sloatsburg, NY, USA.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

By the way i am using ASP.NET.

Jon
  #5 (permalink)  
Old June 7th, 2003, 04:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Try this...

Code:
HttpWebRequest req=WebRequest.Create(url_to_send); 
req.Method="POST";
req.ContentType = "application/x-www-form-urlencoded";


StringBuilder prepared_string = new StringBuilder();
string_to_send="username="+Username+"&password="+Password;
Char[] reserved = {'?', '=', '&'};
byte[] bytes_to_send = null;

int i=0, j;
        while(i<string_to_send.Length)
    {
        j=string_to_send.IndexOfAny(reserved, i);
        if (j==-1)
        {
            prepared_string.Append(HttpUtility.UrlEncode(string_to_send.Substring(i, string_to_send.Length-i)));
            break;
                }
    prepared_string.Append(HttpUtility.UrlEncode(string_to_send.Substring(i, j-i)));
    prepared_string.Append(string_to_send.Substring(j,1));
    i = j+1;
        }

bytes_to_send = Encoding.UTF8.GetBytes(prepared_string.ToString());
req.ContentLength = bytes_to_send.Length;

WebResponse wresp=req.GetResponse();
Stream strim=wresp.GetResponseStream();
StreamReader sr=new StreamReader(strim);
string line;
while ((line=sr.ReadLine())!=null)
    {
        //processing line variable
    }
strim.Close();
...but the Soon is eclipsed by the Moon


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any sites based on the book? oooshola BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 155 January 9th, 2010 02:57 AM
cert sites? vartham Need help with your homework? 1 October 28th, 2006 12:22 PM
SSIS - Built-In Logging / Custom Logging ivobecker23 SQL Server 2005 0 April 21st, 2006 05:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.