Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 System.Data.SqlClient;
- using System.Security.Cryptography;
- namespace proba
- {
- public partial class Form1 : Form
- {
- SqlConnection connection;
- string connectionString = "Server=U2PC07\\SQLEXPRESS; Database=steam; Integrated Security=SSPI;";
- SqlCommand command;
- SqlDataReader dataReader;
- string sql = "SELECT dbo.Game.name, dbo.[User].username FROM dbo.Game INNER JOIN dbo.Library ON dbo.Game.appID = dbo.Library.appID INNER JOIN dbo.[User] ON dbo.[User].idU = dbo.Library.idU";
- public Form1()
- {
- InitializeComponent();
- connection = new SqlConnection(connectionString);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- connection.Open();
- command = new SqlCommand(sql, connection);
- dataReader = command.ExecuteReader();
- string bibl = "";
- while (dataReader.Read())
- bibl += dataReader.GetValue(1) + " ima igricu " + dataReader.GetValue(0) + Environment.NewLine;
- MessageBox.Show(bibl);
- connection.Close();
- }
- catch (Exception error)
- {
- MessageBox.Show("Greska: " + error.ToString());
- }
- }
- private void log_Click(object sender, EventArgs e)
- {
- string password = passwd.Text;
- byte[] encodedPassword = new UTF8Encoding().GetBytes(password);
- byte[] hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encodedPassword);
- string encoded = BitConverter.ToString(hash).Replace("-", string.Empty);
- MessageBox.Show(encoded);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement