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

  • Home
  • SEARCH
  • 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 635895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:27:20+00:00 2026-05-13T20:27:20+00:00

From a .NET assembly (non-web app)… The normal response from Bit.ly is somewhat in

  • 0

From a .NET assembly (non-web app)…

The normal response from Bit.ly is somewhat in the form of below. What is recommended way of consuming that result so that I can easily get the value of the shortUrl field? Since the original URL comes back as a “key”, building a model class to deserialize it to and using LINQ does not seem to make sense. In Javascript, a simple .eval would work but what is the recommended approach in .NET since the model would be dynamic?

{ 
    "errorCode": 0, 
    "errorMessage": "", 
    "results": 
    { 
        "http://www.google.com/": 
        { 
            "hash": "xxxxxx", 
            "shortKeywordUrl": "", 
            "shortUrl": "http://bit.ly/xxxxx", 
            "userHash": "1F5ewS" 
        } 
    }, 
    "statusCode": "OK" 
}
  • 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-05-13T20:27:21+00:00Added an answer on May 13, 2026 at 8:27 pm

    .NET provides a mechanism similar to eval (JavaScriptSerializer). If you just need to parse out a few values the code would look like this:

    var serializer = new JavaScriptSerializer();
    var values = serializer.Deserialize<IDictionary<string,object>>( jsonData );
    var results = values["results"] as IDictionary<string,object>;
    var google = results["http://www.google.com/"] as IDictionary<string,object>;
    var shortUrl = results[ "shortUrl" ];
    

    If you’ll be accessing the other data, you can create your own DTO and have the serializer map the JSON data to that.

    public class Bitly
    {
        public string hash{ get; set; }
        public string shortKeywordUrl{ get; set; }
        public string shortUrl{ get; set; }
        public string userHash{ get; set; }
    }
    
    var google = serializer.ConvertToType<Bitly>( results["http://www.google.com/"] );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to return a collection of departments from a .NET assembly to
Is it possible to reference a .NET Assembly from a SQL Server Stored procedure
I'm trying to use a .NET assembly from VB6 via interop without placing it
This is from an example accompanying the agsXMPP .Net assembly. I've read up on
When I try to run a .NET assembly ( boo.exe ) from a network
I have to use a class/assembly made in C# .NET from native C++ application.
I am trying to use a class from a C# assembly in vb.net. The
Using SQLite from .net, Is there a way to access the .dump command or
Scalar-valued functions can be called from .NET as follows: SqlCommand cmd = new SqlCommand(testFunction,
Any GOOD libraries available to access SVN from .net application (using C#). The only

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.