Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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.
Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:25 AM.


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