Download the component (excluding the original file): http://download.csdn.net/source/496787use the following example to create an emailcontactsclass using system; using system. collections. generic; using system. net; using system. text; using opencontactsnet; /// <summary> /// method for obtaining the Email Contact /// </Summary> public class emailcontacts {/// <summary> /// obtain the Email Contact List/ /// </Summary> /// <Param name = "username"> email address </param> /// <Param name = "password"> password </param>/ // <returns> </retu RNS> Public mailcontactlist getcontacts (string username, string password) {If (username. Split ('@'). length! = 2) return NULL; mailcontactlist list = NULL; networkcredential credential = new networkcredential (username, password); Switch (username. split ('@') [1]. tolower () {Case "gmail.com": gmailextract Gmail = new gmailextract (); Gmail. extract (credential, out list); break; Case "Yahoo.com": yahooextract Yahoo = new yahooextract (); Yahoo. extract (credential, out list); break; Case "live.com": Case "hotmail.com": liveextract live = new liveextract (); live. extract (credential, out list); break; default: break;} return list ;}}
2. Create a webform: getcontacts. aspxgetcontacts. aspx. csusing opencontactsnet; void page_load (Object sender, eventargs ARGs) {emailcontacts contacts = new emailcontacts (); mailcontactlist mails = contacts. getcontacts ("username@service.com", "password"); foreach (mailcontact mail in mails) {response. write ("name:" + mail. name); response. write ("Email:" + mail. email );}}