Организационная структура принимающей организации



бет11/11
Дата01.07.2023
өлшемі0,85 Mb.
#103929
түріРеферат
1   2   3   4   5   6   7   8   9   10   11

" + val + "

";
msg.IsBodyHtml = true;
SmtpClient smpt = new SmtpClient("smpt.bk.ru", 587);
smpt.Credentials = new NetworkCredential("freez-man@bk.ru", "Magadan2906953");
smpt.EnableSsl = true;
smpt.Send(msg);
panel1.Visible = true;
}
else { MessageBox.Show("Пожалуйста, проверьте правильность введенных данных!"); }
}

private void button2_Click(object sender, EventArgs e)
{
int code = Convert.ToInt32(textBox5.Text);
if (code == val)
{
string connStr = "server=127.0.0.1;user=root;password=;database=test";
MySqlConnection coon = new MySqlConnection(@connStr);
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = coon;
cmd.CommandText = "INSERT INTO user (Login,Pass,Data) values ('" + textBox1.Text + "','" +
GetMD5Hash(textBox2.Text) + "','" + textBox4.Text + "')";
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
DataSet dataset = new DataSet();
adapter.Fill(dataset);
coon.Close();
MessageBox.Show("Аккаунт зарегистрирован");
this.Hide();
Form2 reg = new Form2();
reg.Show();
}
else { MessageBox.Show("Пожалуйста, проверьте правильность введенных данных!"); }
}
public static string GetMD5Hash(string text)
{
byte[] bytes = Encoding.Unicode.GetBytes(text);
MD5CryptoServiceProvider CSP =
new MD5CryptoServiceProvider();
byte[] byteHash = CSP.ComputeHash(bytes);
string hash = string.Empty;
foreach (byte b in byteHash)
hash += string.Format("{0:x2}", b);
return hash;
}
}
}
Главное окно
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication25
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
}

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Navigate(@"https://www.google.com");
}

private void Form4_Load(object sender, EventArgs e)
{
webBrowser1.Navigate(@"https://www.google.com");
}
}
}



Достарыңызбен бөлісу:
1   2   3   4   5   6   7   8   9   10   11




©emirsaba.org 2024
әкімшілігінің қараңыз

    Басты бет