Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can't add reference to project, Visual studio Pin
CHill609-Oct-15 2:44
mveCHill609-Oct-15 2:44 
GeneralRe: Can't add reference to project, Visual studio Pin
Dave Kreskowiak9-Oct-15 15:02
mveDave Kreskowiak9-Oct-15 15:02 
Questionc# webbrowser control to filter all xmlhttprequest Pin
JueYingCh8-Oct-15 23:00
JueYingCh8-Oct-15 23:00 
GeneralProject Explanation Pin
c31777968-Oct-15 14:59
c31777968-Oct-15 14:59 
GeneralRe: Project Explanation Pin
BillWoodruff8-Oct-15 19:49
professionalBillWoodruff8-Oct-15 19:49 
GeneralRe: Project Explanation Pin
Mycroft Holmes8-Oct-15 20:16
professionalMycroft Holmes8-Oct-15 20:16 
GeneralRe: Project Explanation Pin
OriginalGriff8-Oct-15 21:44
mveOriginalGriff8-Oct-15 21:44 
QuestionConvert Json to C# Pin
Waqas Ahmad8-Oct-15 7:55
Waqas Ahmad8-Oct-15 7:55 
My Php file is returning this json. how can i covert it in c#.
{"response"[
{"user_id":"26","crtloc_lat":"47.678238","crtloc_lng":"-122.131416"},
{"user_id":"27","crtloc_lat":"9.350192","crtloc_lng":"-95.391006"},
{"user_id":"28","crtloc_lat":"47.678238","crtloc_lng":"-122.131416"}
]
}
php file is present at anybodyhere.net/returntest.php

My Code
public async void sendmsg() {
WebRequest request = WebRequest.Create(http://anybodyhere.net/returntest.php);
WebResponse response = await request.GetResponseAsync();


List<Responsemsg> responsemsg;
using (var stream = new StreamReader(response.GetResponseStream()))
{


responsemsg=JsonConvert.DeserializeObject<Responsemsg>(stream.ReadToEnd());

}

foreach (var item in responsemsg)
{
Console.WriteLine("id={0},latitude={1},longitude={2}", item.user_id, item.crtloc_lat, item.crtloc_lng);
}




}



}
public class Responsemsg
{
public string user_id { get; set; }
public string crtloc_lat { get; set; }
public string crtloc_lng { get; set; }
}

public class RootObject
{
public List<Responsemsg> responsemsg { get; set; }
}
</pre>
AnswerRe: Convert Json to C# Pin
Richard Deeming8-Oct-15 9:19
mveRichard Deeming8-Oct-15 9:19 
QuestionSave Stream from Multiple IP Camera Pin
Enobong Adahada8-Oct-15 5:33
Enobong Adahada8-Oct-15 5:33 
AnswerRe: Save Stream from Multiple IP Camera Pin
CHill608-Oct-15 6:21
mveCHill608-Oct-15 6:21 
GeneralRe: Save Stream from Multiple IP Camera Pin
Enobong Adahada8-Oct-15 11:53
Enobong Adahada8-Oct-15 11:53 
QuestionUpload pdf file in MySQL.... Pin
Member 120161068-Oct-15 0:40
Member 120161068-Oct-15 0:40 
AnswerRe: Upload pdf file in MySQL.... Pin
CHill608-Oct-15 1:52
mveCHill608-Oct-15 1:52 
GeneralRe: Upload pdf file in MySQL.... Pin
Member 120161068-Oct-15 15:13
Member 120161068-Oct-15 15:13 
AnswerRe: Upload pdf file in MySQL.... Pin
Pete O'Hanlon8-Oct-15 2:01
mvePete O'Hanlon8-Oct-15 2:01 
GeneralRe: Upload pdf file in MySQL.... Pin
Member 120161068-Oct-15 15:19
Member 120161068-Oct-15 15:19 
AnswerRe: Upload pdf file in MySQL.... Pin
Richard Deeming8-Oct-15 2:10
mveRichard Deeming8-Oct-15 2:10 
GeneralRe: Upload pdf file in MySQL.... Pin
Member 120161068-Oct-15 15:30
Member 120161068-Oct-15 15:30 
GeneralRe: Upload pdf file in MySQL.... Pin
Richard Deeming9-Oct-15 1:52
mveRichard Deeming9-Oct-15 1:52 
GeneralRe: Upload pdf file in MySQL.... Pin
Member 1201610611-Oct-15 15:04
Member 1201610611-Oct-15 15:04 
Questionlocking an app on request Pin
Member 116417407-Oct-15 23:32
Member 116417407-Oct-15 23:32 
AnswerRe: locking an app on request Pin
Dave Kreskowiak8-Oct-15 3:28
mveDave Kreskowiak8-Oct-15 3:28 
AnswerRe: locking an app on request Pin
BillWoodruff8-Oct-15 19:47
professionalBillWoodruff8-Oct-15 19:47 
QuestionHow do I set a DataGridVew column in a ListView BOLD? Pin
Robert Oujesky7-Oct-15 11:10
Robert Oujesky7-Oct-15 11:10 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.