I have a json file like this:

{
    "list": [
        {
            "ID" : "1",
            "value" : "value is one"
        }
        {
            "ID" : "2",
            "value" : "value is two"
        }
        {
            "ID" : "3",
            "value" : "value is three"
        }
        {
            "ID" : "4",
            "value" : "value is four"
        }
    ]
}


what I want to do is read the josn file and returns the message based on the ID i specify. So for example

if (this.list.containsKey("1"))
    {
        return this.list.get(messageTitle);
    }


That's what I tried but it returns all the values and ID.

JSONParser parser = new JSONParser();
try {
    Object obj = parser.parse(new FileReader("jsonFile.json"));
    JSONObject jsonObject = (JSONObject) obj;
    // loop array
    JSONArray msg = (JSONArray) jsonObject.get("list");
    Iterator&lt;String&gt; iterator = msg.iterator();
    while (iterator.hasNext()) {
        System.out.println(iterator.next());
    }
}



Question: Accessing Fonts folder from console application with target framework 3.5
Answer: The fonts folder is typically located at %windir%\Fonts, so you should be able to get the location like this:

Path.Combine(
    System.Environment.GetEnvironmentVariable("windir"),
    "Fonts");


It is a virtual folder, so in theory it could be located somewhere else. In practice, I've never seen that happen or heard of it happening. (Microsoft is confident enough in this location to reference it on their "how to install a font" page). I'm sure that if you're trying to locate a specific file name like that you have good error handling already, though.

Bonus information:

You might know this already, but if you need to know what classes, methods, etc. are available in a specific version of the .net framework, you can find out from MSDN. Go to the documentation page (say this one on Environment.SpecialFolder), and click on the ".NET Framework 4.5" link in the top left corner and choose a different version to see the page you are looking at as it was in that version.