Click here to Skip to main content
Click here to Skip to main content

Address Book Grabber

By , 26 Feb 2008
 

I have got two ways to grab the address book from any website....

1. By using DownloadData and UploadValues methods of WebClient class:

The Basic algorithm is:

1. Create WebClient class object to get the methods for sending and receiving the data from a resource identified by a URL.

2. Set the user agent info in the header and set the proxy setting.

3. Download the login page.

4. By the Regular Expression Extract the desire name value collection which we have to send with login info for example user name, password etc. to get the address book.

5. Again set the header information’s such as user agent etc.

6. Upload the page and get the cookies information.

7. Download the address book page.

8. Create the name value collection.

9. set the header information such as cookies info, user agent etc.

10. Upload the page with name value collection it will return address book in byte array format.

Please refer the attached code file: Contact_Importer_.aspx.cs.zip.

2. By using the HTTPWebRequest and HTTPWebResponse HTTP classes of the .NET framework:

The Basic algorithm is:

1. The first step for getting a web page is to instantiate an HttpWebRequest object. This occurs when invoking the static Create () method of the WebRequest class.

2. Set request header fields and user credentials.

3. Get response from the server in stream object and add user credential information with it.

4. Send further Request by sending cookie within the request.

5. Again use create () method to open address book page.

6. Get the response by sending cookie information with the request it will return address book page in byte array format.

Please refer the attached code file: Contact_Page_Importer.cs.zip

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Himanshu_Jain
Software Developer Persistent System Limited
India India
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionCould not download Contact_Importer_ - 2.31 KBmemberAndrew G Avelin15 Mar '12 - 20:12 
Download Contact_Importer_ - 2.31 KB
 
Please check it...
GeneralNeed more dialogmemberDonsw8 Jan '09 - 5:52 
Questionasp.netmemberreminston4 Sep '08 - 1:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 27 Feb 2008
Article Copyright 2008 by Himanshu_Jain
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid