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 6884259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:29:06+00:00 2026-05-27T05:29:06+00:00

Please forgive the poor code and ignorance this is just a late night hack

  • 0

Please forgive the poor code and ignorance this is just a late night hack to test something.

Anyways I’m trying to use RESTSharp with WP7 but I’m hitting a hurdle which I unable to figure out.

Could someone please take a look?

Code:

namespace McMyAdmin.Data
{
    [DataContract]
    public class Status
    {
        private bool isRunning;
        private bool isReady;
        private int ram;
        private int maxRam;
        private int users;
        private int maxusers;
        private DateTime startDateTime;
        private int cpuUsage;

        [DataMember(Name = "running")]
        public bool IsRunning { get { return isRunning; } set { isRunning = value; } }
        [DataMember(Name = "ready")]
        public bool IsReady { get { return isReady; } set { isReady = value; } }
        [DataMember(Name = "ram")]
        public int Ram { get { return ram; } set { ram = value; } }
        [DataMember(Name = "maxram")]
        public int MaxRam { get { return maxRam; } set { maxRam = value; } }
        [DataMember(Name = "users")]
        public int Users { get { return users; } set { users = value; } }
        [DataMember(Name = "maxusers")]
        public int MaxUsers { get { return maxusers; } set { maxusers = value; } }
        [DataMember(Name = "starttime")]
        public DateTime StartDateTime { get { return startDateTime; } set { startDateTime = value; } }
        [DataMember(Name = "cpuusage")]
        public int CPUUsage { get { return cpuUsage; } set { cpuUsage = value; } }


        public Status GetStatus()
        {
            var webclient = new RestClient
            {
                BaseUrl = "http://localhost:8080",
                Authenticator = new HttpBasicAuthenticator("admin","xxxxxxxx")
            };
            var request = new RestRequest("data.json", Method.GET);
            request.AddParameter("req", "status");

            Status test = new Status();

            var sd = webclient.ExecuteAsync<Status>(request, (response) =>
            {
                test.isRunning = response.Data.isRunning;
                test.isReady = response.Data.isReady;
                test.Ram = response.Data.Ram;
                test.MaxRam = response.Data.MaxRam;
                test.Users = response.Data.Users;
                test.MaxUsers = response.Data.MaxUsers;
                test.StartDateTime = response.Data.StartDateTime;
                test.CPUUsage = response.Data.CPUUsage;
            });

            return test;
        }
    }
 }

This does not produce any errors but instead rubbish data which is the following

        CPUUsage    0   int
        IsReady false   bool
        IsRunning   false   bool
        MaxRam  0   int
        MaxUsers    0   int
        Ram 0   int
        startDateTime   {1/1/0001 12:00:00 AM}  System.DateTime
        Users   0   int

but compare this to the acutally Json this is completly wrong

{"status":200,"running":true,"ready":true,"stopping":false,"failed":false,"failmsg":"","maxram":1024,"users":0,"maxusers":8,"userinfo":{},"time":"2011-12-03 23:46:54","ram":"241","starttime":"12/03/2011 17:32:04","cpuusage":0}

Thanks in advance

  • 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-27T05:29:07+00:00Added an answer on May 27, 2026 at 5:29 am

    DataMember attributes are ignored. Check out the Deserialization docs, or try Hammock.

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

Sidebar

Related Questions

Please forgive my ignorance. Traditionally I've been doing something like this, but it feels
Please forgive my ignorance and poor SQL programming skills but I am normally a
This is my first post, and first please forgive me for my poor english.
Please forgive my simple question. I have just started to use Matplotlib and I
this code crashes with EXC_BAD_ACCESS (please forgive me the formatting, I seem to be
please forgive me for my poor english and my big ignorance on programming. I'm
Please forgive this stupid question. (I'm originally an ASP.NET programmer.) I'm trying to add
Please forgive me if this is an obvious one. I have an unknown amount
Please forgive the verbosity of the following code example. Using Delphi 2009, I created
Please forgive my programming knowledge. I know this is a simple thing, but I

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.