-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnect.cs
More file actions
100 lines (88 loc) · 2.76 KB
/
Copy pathConnect.cs
File metadata and controls
100 lines (88 loc) · 2.76 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using Npgsql;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading.Tasks;
namespace HTMLreader
{
partial class Program
{
abstract class Connect
{
public NpgsqlConnection connection;
public Connect(String SERVER, string PORT, String USER, String PASSWORD, String DATABASE, String SslMode)
{
connection = new NpgsqlConnection(
"Server=" + SERVER + ";" +
"Port=" + PORT + ";" +
"User Id=" + USER + ";" +
"Password=" + PASSWORD + ";" +
"Timeout=1024;"+
"Database=" + DATABASE + ";"+
"SslMode=" +SslMode+ ";"
);
}
public NpgsqlConnection Connection
{
get {return connection;}
set{ }
}
public virtual void Open()
{
try
{
connection.Open();
}
catch (NpgsqlException ex)
{
Console.WriteLine(ex);
}
}
public virtual void Close()
{
try
{
connection.Close();
}
catch (NpgsqlException ex)
{
Console.WriteLine(ex);
}
}
}
class setPimstalnew:Connect
{
public setPimstalnew (String SERVER= "10.1.5.30", string PORT= "5432", String USER= "testdbuser", String PASSWORD= "Xai7aer7pu", String DATABASE="pimstalnew", String SslMode= "Disable")
:base (SERVER,PORT,USER,PASSWORD,DATABASE,SslMode)
{}
// public void Pimstalnew()
// {
// String SERVER = "10.1.5.30";
// string PORT = "5432";
// String USER = "testdbuser";
// String PASSWORD = "Xai7aer7pu";
// String DATABASE = "pimstalnew";
// String SslMode = "Disable";
// //Connect(SERVER,PORT,USER,PASSWORD,DATABASE,SslMode,SslMode);
// }
}
class setPraporty:Connect
{
public setPraporty (String SERVER="10.1.5.30", string PORT = "5432", String USER = "testdbuser", String PASSWORD = "Xai7aer7pu", String DATABASE = "praporty", String SslMode = "Disable")
:base (SERVER,PORT,USER,PASSWORD,DATABASE,SslMode)
{}
// public void Praporty()
// {
// String SERVER = "10.1.5.30";
// string PORT = "5432";
// String USER = "testdbuser";
// String PASSWORD = "Xai7aer7pu";
// String DATABASE = "praporty";
// String SslMode = "Disable";
// }
}
}
}