Happy NET Auxiliary Program development notes (ii): Get friends private car bit information

Source: Internet
Author: User
Tags json tostring

In the note, "Happy NET Auxiliary program development notes", a simple record of how to log in happy, to obtain "Parking" related data: Players (parking) information, player vehicle parking information, players parking situation, such as private car. In this post, you will simply describe the player's buddy information and the player's private car parking. Say not much, enter the text.

First, get the player friend information

In fact, in the previous note, there are mentioned v_frienddata variables, in fact, the player friend information is stored in the JSON format in the variable, we need to write a good corresponding entity, and then use Json.NET to do a conversion on it. Since the previous article did not detail how to use Json.NET to convert JSON, here's how to add it.

Let's take a look at the tree structure of JSON in a variable:

Where the UID is 1, 2 is the default neighbor that the system adds to the player. The following are entity classes (see the source code that came with the previous note for EntityBase entities):

Using System;
Using System.Collections.Generic;
Using System.Text;
Namespace SNSHelper.Kaixin001.Entity
{
public class Parkerfriendinfo:entitybase
{
Public Parkerfriendinfo (Object obj)
: Base (obj)
{
}
public string UId
{
Get
{
return jsobj["UID"]. ToString ();
}
}
public string Realname
{
Get
{
Return Utility.unicode2character (jsobj["Real_name"). ToString ());
}
}
public string Ta
{
Get
{
Return Utility.unicode2character (jsobj["ta"). ToString ());
}
}
public string full
{
Get
{
Return jsobj[' full '. ToString ();
}
}
public string Scenemoney
{
Get
{
return jsobj["Scenemoney"]. ToString ();
}
}
public string Scenename
{
Get
{
Return Utility.unicode2character (jsobj["Scenename"). ToString ());
}
}
public string Neighbor
{
Get
{
return jsobj["neighbor"]. ToString ();
}
}
public string Online
{
Get
{
return jsobj["Online". ToString ();
}
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.