Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8606411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:05:13+00:00 2026-06-12T03:05:13+00:00

I’m trying to read a Json string in C#, but I’m having trouble figuring

  • 0

I’m trying to read a Json string in C#, but I’m having trouble figuring out just how to parse the string into C#. Say I have the following Json string

[
    {
        "AppName": {
            "Description": "Lorem ipsum dolor sit amet",
            "Value": "1"
        },
        "AnotherAppName": {
            "Description": "consectetur adipisicing elit",
            "Value": "String"
        },
        "ThirdAppName": {
            "Description": "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
            "Value": "Text"
        },
        "Application": {
            "Description": "Ut enim ad minim veniam",
            "Value": "100"
        },
        "LastAppName": {
            "Description": "quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat",
            "Value": "ZZZ"
        }
    }
]

I want to parse that into an arraylist or dictionary, using a format like

descriptionList["AppName"] = "Lorem ipsum dolor sit amet";
valueList["AppName"] = "1";

I’ve been toying around with Json.Net but the examples I’ve seen don’t give me a clear idea of how I should do this. What’s the best way to achieve this? Cant this be done like in jQuery, using a foreach statement?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:05:14+00:00Added an answer on June 12, 2026 at 3:05 am

    I’m using Json.net in my project and it works great. In you case, you can do this to parse your json:

    EDIT: I changed the code so it supports reading your json file (array)

    Code to parse:

    void Main()
    {
        var json = System.IO.File.ReadAllText(@"d:\test.json");
    
        var objects = JArray.Parse(json); // parse as array  
        foreach(JObject root in objects)
        {
            foreach(KeyValuePair<String, JToken> app in root)
            {
                var appName = app.Key;
                var description = (String)app.Value["Description"];
                var value = (String)app.Value["Value"];
    
                Console.WriteLine(appName);
                Console.WriteLine(description);
                Console.WriteLine(value);
                Console.WriteLine("\n");
            }
        }
    }
    

    Output:

    AppName
    Lorem ipsum dolor sit amet
    1
    
    
    AnotherAppName
    consectetur adipisicing elit
    String
    
    
    ThirdAppName
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
    Text
    
    
    Application
    Ut enim ad minim veniam
    100
    
    
    LastAppName
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
    ZZZ
    

    BTW, you can use LinqPad to test your code, easier than creating a solution or project in Visual Studio I think.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
This could be a duplicate question, but I have no idea what search terms
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.