TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harsh Gupta
NA
1
1.1k
hotmail contacts fetch generate code error comes 401
Jan 13 2015 2:14 AM
public ActionResult tryhotmaillogin()
{
try
{
Response.Redirect("https://oauth.live.com/authorize?client_id=" + cid + "&scope=wl.signin%20wl.basic&response_type=code&redirect_uri=http://www.joblisting.com/Network/tryhotmailcode");
}
catch (Exception e)
{
Response.Write(e.Message);
}
return View();
}
[HttpGet]
public ActionResult tryhotmailcode(string code)
{
try
{
var request = WebRequest.Create("https://oauth.live.com/token?client_id=" + cid + "&redirect_uri=http://www.joblisting.com/Network/tryhotmailaccesstoken&client_secret=" + csec + "&code=" + code + "&grant_type=authorization_code");
//string text = null;
//var response = (HttpWebResponse)request.GetResponse();
//request.ContentType = "application/json; charset=utf-8";
//using (var sr = new StreamReader(response.GetResponseStream()))
//{
// text = sr.ReadToEnd();
//}
//NameValueCollection responseCollection = System.Web.HttpUtility.ParseQueryString(text);
//string token = responseCollection["access_token"];
//ViewBag.token = token;
//var request1 = WebRequest.Create("https://apis.live.net/v5.0/me?access_token=" + token);
//var response1 = (HttpWebResponse)request1.GetResponse();
//DataSet dshotmail = new DataSet();
//var hotmailStream = new StreamReader(response1.GetResponseStream());
//// dshotmail.ReadXml(hotmailStream);
//ViewBag.Data = hotmailStream;
}
catch (Exception e)
{
Response.Write(e.Message);
}
return View();
}
public ActionResult tryhotmailaccesstoken(string AccessToken)
{
try
{
var request1 = WebRequest.Create("https://apis.live.net/v5.0/me?access_token=" + AccessToken);
var response1 = (HttpWebResponse)request1.GetResponse();
DataSet dshotmail = new DataSet();
var hotmailStream = new StreamReader(response1.GetResponseStream());
dshotmail.ReadXml(hotmailStream);
ViewBag.list = dshotmail;
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
return View();
}
Reply
Answers (
0
)
Check if user is following on Twitter using twitter API 1.1
Select datagridview row