WeChat lottery games and email Lottery Games

Source: Internet
Author: User

Lottery Games and email Lottery Games

I have just played a scratch card game recently. Now I want to share my ideas with you. Let's take a look.

The page is not described on the Internet. You can use Baidu directly. When a user enters the page, the background obtains the mac address of the user and saves it to the database as the user's sign, so that the number of Lottery draws can be refreshed when the user enters the page the next day.

public static NetworkInterface[] NetCardInfo()        {          return NetworkInterface.GetAllNetworkInterfaces();        }        public string GETMAC()        {          List<string> macs =new List<string>();          NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();          foreach (NetworkInterface ni in interfaces)          {              if (ni.GetPhysicalAddress().ToString() != "")              {                  macs.Add(ni.GetPhysicalAddress().ToString());              }          }          return macs[0];        }

The lottery result is a random number generated directly on the user's page and matched with the database. The image after the scratch card is changed according to the result. After a user clicks the tab, the user jumps to a different page based on whether the user wins the prize. The following code is used to determine whether the user clicks the tab.

Canvas. addEventListener ('mouseup', function (e) {e. preventDefault (); var num = 0; var datas = ctx. getImageData (0, 0, 320,400); for (var I = 0; I <datas. data. length; I ++) {if (datas. data [I] = 0) {num ++ ;};}; if (num> = datas. data. length * 0.7) {ctx. fillRect (0, 0, 320,400); var I = '<% = geti () %>'; if (I = 1) {I ++; var stsr = '<% = str %>'; if (stsr! = "") {Alert ("Congratulations, you are in progress" + stsr + "! Will jump to the award page. "); setTimeout (function () {window. location. href ("userInfo. aspx ") ;}, 1000) ;}else {document. getElementById ('btn '). style. display = "block";} if (I = 2) {return ;}}};});

If you have any shortcomings in the first blog, please kindly advise.

Related Article

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.