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.