Happy NET Auxiliary Program development notes (iii): Realize parking function

Source: Internet
Author: User

In the previous two notes, a more detailed description of how to use tools to analyze the Web page and how to write code to implement some simple functions. If there are follow-up notes, I will simply record the "Happy Net Auxiliary program" in the development process of the main problems and solutions.

In this post, the author will briefly describe how to achieve a simple parking function, and make a simple interface to present the development of a series of notebooks.

First, the identification of friends of the private car in the free parking space: Parking to the free parking space but will not receive a penny, so you must not park the car to the free parking.

Through Firebug debugging found that when the player clicks on the "parking" in the middle of Flash parking button, Parking-7.js 169th business Parking_park method will be implemented.

g_curparkid = parkid;
var v_park_free = (parseInt(g_curparkid) >> 16) & 0xff;

In Parking-park, you have the above code. Where the incoming parameter parkid is in the "Happy Net Auxiliary program development notes (ii): Get friends private car bit information" Get friends private car bit information in the Parkid. You don't know what JavaScript means when a friend sees this code and is confused.

1. Bitwise operator ">>" in Javscript: for bit operators in JS, refer to http://www.w3school.com.cn/js/as_js_operators_bitwise.asp. In C #, the right shift operator is also ">>". such as: 67174403 >> 16 = 1025;

2.0xff: This is actually a number expressed in 16, corresponding to the decimal 255

In the program, the author in Parkinginfo this entity class to add a property isparkfree to mark whether the parking space is free

<summary>
Is it a free parking space?
</summary>
public bool Isparkfree
{
Get
{
Return Convert.toboolean (parkid >> & 255);
}
}

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.