NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

///////////////////////////////////////CASİNO//////////////////////

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Casino
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Image1.ImageUrl = setImages();
Image2.ImageUrl = setImages();
Image3.ImageUrl = setImages();
ViewState.Add("Money", 100);
moneyLabel.Text = string.Format("Oyuncunun parası: {0:C}", ViewState["Money"]);
}
}

protected void okButton_Click(object sender, EventArgs e)
{
int money = (int)ViewState["Money"];
if (int.TryParse(betTextBox.Text, out int bet))
{
int mul;
Image1.ImageUrl = setImages();
Image2.ImageUrl = setImages();
Image3.ImageUrl = setImages();
mul = evaluate(bet);
if (mul == 0)
{
money = money - bet;
resultLabel.Text = string.Format("Üzgünüm, {0:C} kaybettiniz. Şansınızı tekrar deneyiniz", bet);
}
else
{
money += mul;
resultLabel.Text = string.Format("{0:C} ortaya koydunuz, {1:C} kazandınız", bet, mul);
}
moneyLabel.Text = string.Format("Oyuncunun parası: {0:C}", money);
ViewState["Money"] = money;
}
}

Random random = new Random();
private string setImages()
{
string[] images = new string[] { "bar", "bell", "cherry", "clover", "diamond", "heart", "horseshoe", "lemon", "orange", "plum", "seven", "watermelon" };
string image = images[random.Next(11)];
return image + ".png";
}

private int evaluate(int bet)
{
string image1Name = getImageName(Image1.ImageUrl);
string image2Name = getImageName(Image2.ImageUrl);
string image3Name = getImageName(Image3.ImageUrl);
int mul=0;

if (image1Name != "bar" && image2Name != "bar" && image3Name != "bar")
{
if (image1Name == "cherry" || image2Name == "cherry" || image3Name == "cherry")
{
mul = bet * 2;
}

if ((image1Name == "cherry" && image2Name == "cherry") || (image1Name == "cherry" && image3Name == "cherry") || (image2Name == "cherry" && image3Name == "cheery"))
{
mul = bet * 3;
}

if (image1Name == "cherry" && image2Name == "cherry" && image3Name == "cherry")
{
mul = bet * 4;
}
if (image1Name == "seven" && image2Name == "seven" && image3Name == "seven")
{
mul = bet * 100;
}
}
else
mul = bet * 0;
return mul;
}

private string getImageName(string image)
{
int length = image.IndexOf('.');
string imageName = image.Substring(0, length);
return imageName;
}
}
}
//////////////////////////////////KAYNAK//////////////////////////////////////////

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Casino.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" Height="150px" Width="150px" />
<asp:Image ID="Image2" runat="server" Height="150px" Width="150px" />
<asp:Image ID="Image3" runat="server" Height="150px" Width="150px" />
<br />
<br />
Bahis Koy:
<asp:TextBox ID="betTextBox" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="okButton" runat="server" OnClick="okButton_Click" Text="ŞANSINI DENE" />
<br />
<br />
<asp:Label ID="resultLabel" runat="server"></asp:Label>
<br />
<br />
<asp:Label ID="moneyLabel" runat="server"></asp:Label>
<br />
<br />
1 Kiraz - Bahisin 2 katını kazan<br />
2 Kiraz - Bahisin 3 katını kazan<br />
3 Kiraz - Bahisin 4 katını kazan<br />
<br />
3 tane 7 - Bahisin 100 katını kazan<br />
Ancak bir tane bile BAR gelirse, hiçbir şey kazanamazsın</div>
</form>
</body>
</html>
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.