using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using MySql.Data.MySqlClient; using Holo; namespace Licenza { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { string connectionString = "datasource=localhost;username=root;password=master;database=AlphaStudio"; MySqlConnection mySqlConnection = new MySqlConnection(connectionString); string selectString = "SELECT username, licenza " + "FROM licenza " + "WHERE username = '" + textBox1.Text + "' AND licenza = '" + textBox2.Text + "'"; MySqlCommand mySqlCommand = new MySqlCommand(selectString, mySqlConnection); mySqlConnection.Open(); String strResult = String.Empty; strResult = (String)mySqlCommand.ExecuteScalar(); mySqlConnection.Close(); if (strResult.Length == 0) { label1.Text = "INCORRECT USER/LICENZE"; } else { label1.Text = "YOU ARE LOGGED IN!"; frmMain frmMain = new frmMain(); frmMain.Show(); } } // ok?????? va o private void button2_Click(object sender, EventArgs e) { } private void registramiToolStripMenuItem_Click(object sender, EventArgs e) { Form2 form2 = new Form2(); form2.Show(); } } }