-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDB.cs
30 lines (27 loc) · 815 Bytes
/
DB.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Шифровщик
{
internal class DB
{
MySqlConnection connectionsql = new MySqlConnection($"server=localhost;port=3306;username=root;password={Form1.pass};database=cryption");
public void OpenConnection()
{
if(connectionsql.State == System.Data.ConnectionState.Closed)
connectionsql.Open();
}
public void CloseConnection()
{
if (connectionsql.State == System.Data.ConnectionState.Open)
connectionsql.Close();
}
public MySqlConnection getConnection()
{
return connectionsql;
}
}
}