Add project files.
This commit is contained in:
parent
1ee67f30b2
commit
6d7624c185
25
Lotto.sln
Normal file
25
Lotto.sln
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33213.308
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lotto", "Lotto\Lotto.csproj", "{E5C72B18-4009-440B-AD2E-7DF000598527}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E5C72B18-4009-440B-AD2E-7DF000598527}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E5C72B18-4009-440B-AD2E-7DF000598527}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E5C72B18-4009-440B-AD2E-7DF000598527}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E5C72B18-4009-440B-AD2E-7DF000598527}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {17557986-A746-4E73-B249-D28F2C0BE52B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
116
Lotto/Form1.Designer.cs
generated
Normal file
116
Lotto/Form1.Designer.cs
generated
Normal file
|
@ -0,0 +1,116 @@
|
|||
namespace Lotto
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.SorsolasCimke = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(12, 26);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(776, 34);
|
||||
this.button1.TabIndex = 0;
|
||||
this.button1.Text = "Sorsolás";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(12, 268);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(776, 34);
|
||||
this.button2.TabIndex = 1;
|
||||
this.button2.Text = "Ellenörzés";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// SorsolasCimke
|
||||
//
|
||||
this.SorsolasCimke.Font = new System.Drawing.Font("Microsoft Sans Serif", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.SorsolasCimke.Location = new System.Drawing.Point(12, 72);
|
||||
this.SorsolasCimke.Name = "SorsolasCimke";
|
||||
this.SorsolasCimke.Size = new System.Drawing.Size(776, 118);
|
||||
this.SorsolasCimke.TabIndex = 1;
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(12, 226);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(776, 23);
|
||||
this.textBox1.TabIndex = 3;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.BackColor = System.Drawing.Color.Turquoise;
|
||||
this.label2.Location = new System.Drawing.Point(12, 323);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(776, 27);
|
||||
this.label2.TabIndex = 5;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Location = new System.Drawing.Point(12, 199);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(128, 24);
|
||||
this.label3.TabIndex = 5;
|
||||
this.label3.Text = "Lottószelvény számai:";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.SorsolasCimke);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Button button1;
|
||||
private Button button2;
|
||||
private Label SorsolasCimke;
|
||||
private TextBox textBox1;
|
||||
private Label label2;
|
||||
private Label label3;
|
||||
}
|
||||
}
|
89
Lotto/Form1.cs
Normal file
89
Lotto/Form1.cs
Normal file
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
|
||||
namespace Lotto
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
int[] sorsoltak = new int[5];
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Random rd = new Random();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
bool marvan;
|
||||
do
|
||||
{
|
||||
sorsoltak[i] = rd.Next(1, 91);
|
||||
marvan = false;
|
||||
for (int j = 0; j < i; j++)
|
||||
{
|
||||
marvan = marvan || (sorsoltak[j] == sorsoltak[i]);
|
||||
}
|
||||
} while (marvan);
|
||||
}
|
||||
|
||||
Array.Sort(sorsoltak);
|
||||
|
||||
SorsolasCimke.Text = $"{sorsoltak[0]} {sorsoltak[1]} {sorsoltak[2]} {sorsoltak[3]} {sorsoltak[4]}";
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
string beirva = textBox1.Text;
|
||||
string[] szamok = beirva.Split(';');
|
||||
if (szamok.Length != 5)
|
||||
{
|
||||
label2.Text = "Nem öt értéket adott meg vagy nem jó a választókarakter!";
|
||||
}
|
||||
else
|
||||
{
|
||||
int talalat = 0;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
int lsz = int.Parse(szamok[i]);
|
||||
if (lsz < 1 || lsz > 90)
|
||||
{
|
||||
label2.Text = $"Az {i + 1}. szám nem 1-90 közötti!";
|
||||
talalat = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (int s in sorsoltak)
|
||||
{
|
||||
if (s == lsz) talalat++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
label2.Text = $"Az {i + 1}. érték nem szám!";
|
||||
talalat = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (talalat > -1) label2.Text = "Találatok száma: " + talalat;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
60
Lotto/Form1.resx
Normal file
60
Lotto/Form1.resx
Normal file
|
@ -0,0 +1,60 @@
|
|||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
11
Lotto/Lotto.csproj
Normal file
11
Lotto/Lotto.csproj
Normal file
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
17
Lotto/Program.cs
Normal file
17
Lotto/Program.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
namespace Lotto
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user