I wrote a program where a user inputs an address, clicks a linklabel and the program will download the text on a website into a text box.
That code looks like this:
private void llbMap_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var _address = txtAddress.Text + " " + txtCity.Text + " " + "NY " + txtZip.Text;
txtFullAddress.Text = _address.ToString();
string toolDistanceMeasuring = "https://mywebsite.net/distance/?Type=json&Token=TUdBIFN5c3RlbXM1&Address=" + _address;
WebClient wc = new WebClient();
byte[] raw = wc.DownloadData(toolDistanceMeasuring);
string webData = Encoding.UTF8.GetString(raw);
txtWebData.Text = webData.ToString();
}
When the user clicks the LinkLabel txtWebData is filled with this:
{
"status":"OK",
"fromlatitude":40.86791,
"fromlongitude":-73.428906,
"locationtype":"ROOFTOP",
"distancecoastmiles":1.7,
"closestdistancelatitude":40.8704815141,
"closestdistancelongitude":-73.4612902712,
"elevationstart":91.9,
"elevationend":0
}
I want to know how I can extract just the "distancecoastmiles" from that textbox and put that data in another textbox. Any ideas how I might be able to accomplish that?