char[] separators = { '=', '&' };
string[] responseContent = responseString.Split(separators);
string accessToken = responseContent[1];
int userId = Int32.Parse(responseContent[5]);
MessageDialog dialogSuccess = new MessageDialog("access_token = "+accessToken+ "\nuser_id = "+userId);
dialogSuccess.ShowAsync();
private ReadOnlyCollection<Post> Remove(ReadOnlyCollection<Post> ROCWall, int index)
{
List<Post> pist = new List<Post>();
for (int i = 0; i < ROCWall.Count; i++)
{
if (i != index) pist.Add(ROCWall[i]);
}
ReadOnlyCollection<Post> value = new ReadOnlyCollection<Post>(pist);
return value;
}
string json = @"{
'href': '/account/login.aspx',
'target': '_blank'
}";
Dictionary<string, string> htmlAttributes = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
Console.WriteLine(htmlAttributes["href"]);
// /account/login.aspx
Console.WriteLine(htmlAttributes["target"]);
// _blank
Uri dataUri = new Uri("ms-appx:///DataModel/TextFile1.txt");
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
IList<string> localList;
localList = new List<string>();
localList = await FileIO.ReadLinesAsync(file);
for (int i = 0; i < localList.Count; i += 8)
{
commonWidget.Add(new Widget
{
Id = Convert.ToInt32(localList[i]),
Name = localList[i+1],
Bithday = localList[i+2],
Description = localList[i + 4],
ImagePath = localList[i + 3],
Career = localList[i + 5]
});
}