Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:41:45+00:00 2026-06-08T21:41:45+00:00

How to get the Hotmail email contacts not the email hash in asp.net using

  • 0

How to get the Hotmail email contacts not the email hash in asp.net using C#?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:41:47+00:00Added an answer on June 8, 2026 at 9:41 pm

    We can get the email using delegate authentication. Here is the code snippet which I have done.

    enter code here

    public partial class DefaultPage : System.Web.UI.Page
    {
        //Comma-delimited list of offers to be used.
        const string Offers = "Contacts.View";
        //Name of cookie to use to cache the consent token. 
        const string AuthCookie = "delauthtoken";
    
        // Initialize the WindowsLiveLogin module.
        static WindowsLiveLogin wll = new WindowsLiveLogin(true);
    
        protected WindowsLiveLogin.ConsentToken Token;
    
        protected string ConsentUrl;
    
        protected void Page_Load(object sender, EventArgs e)
        {
            //Get the consent URL for the specified offers.
            ConsentUrl = wll.GetConsentUrl(Offers);
    
            HttpRequest req = HttpContext.Current.Request;
            HttpCookie authCookie = req.Cookies[AuthCookie];
    
            // If the raw consent token has been cached in a site cookie, attempt to
            // process it and extract the consent token.
            if (authCookie != null)
            {
                string t = authCookie.Value;
                Token = wll.ProcessConsentToken(t);
                getContacts(Token.DelegationToken,Token.LocationID);
                if ((Token != null) && !Token.IsValid())
                {
                    Token = null;
                }
            }
        }
    
        private void getContacts(string token, string lId)
        {
            long intlid = Int64.Parse(lId, System.Globalization.NumberStyles.HexNumber);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format("https://livecontacts.services.live.com/users/@C@{0}/rest/livecontacts/contacts/", intlid));
            request.UserAgent = "Windows Live Data Interactive SDK";
            request.ContentType = "application/xml; charset=utf-8";
            request.Method = "GET";
            request.Headers.Add("Authorization", "DelegatedToken dt=\"" + token + "\"");
    
            using (WebResponse response = request.GetResponse())
            {
                using (Stream stream = response.GetResponseStream())
                {
                    //docNav = new XPathDocument(stream);
                    StreamReader reader = new StreamReader(stream);
                  //  var contactStreamReponse = reader.ReadToEnd();
    
                  //  XmlDocument contacts = new XmlDocument();
                  //  contacts.LoadXml(contactStreamReponse);
    
    
    
                    //Use the document. For example, display contacts.InnerXml.
    
                  //  labelXml.Text = contacts.InnerXml;
    
                    if (CheckBoxList1.Items.Count < 1)
                    {
                        DataSet ds = new DataSet();
                        ds.ReadXml(reader);
                        response.Close();
                        if (ds.Tables["Contact"].Rows.Count > 0)
                        {
                            ArrayList al = new ArrayList();
    
                            for (int intC = 0; intC < ds.Tables["Email"].Rows.Count; intC++)
                            {
                                //Response.Write("FOr instance" + intC);
    
                                //Response.Write(ds.Tables["Email"].Rows[intC]["Address"].ToString());
                                ///Response.Write("<br>");
                                al.Add(ds.Tables["Email"].Rows[intC]["Address"].ToString());
                            }
                            CheckBoxList1.DataSource = al;
                            CheckBoxList1.DataBind();
    
                        }
    
                    }
                    else
                    {
                        return;
                    }
                }
    
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get email contact from hotmail with php or javascript. I
i am writing a program that will connect to a hotmail email account a
I am retriveing data from a soap api using php. but unable to get
how to get web address of email service from an email address? Most of
I am using phps mail() function to send confirmation e-mails. The e-mails get received
As the title says I'm trying to get a simple email working with Heroku
On GAE, a non-gmail user can create a Google Account using their non-gmail email
Im having problem in importing hotmail contacts from hotmail in php it simple give
Chip,Dirkland,DrobæSphere Inc,cdirkland@hotmail.com,usa I've been trying to use sed to modify email addresses in a
I'm using PEAR to send HTML emails from my website. My email are sent,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.