BioCore  5.0.0
A Windows .NET microscopy library and application for viewing, editing, and annotating images.
Loading...
Searching...
No Matches
Login.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9using System.Windows.Forms;
10
11namespace BioCore
12{
13 public partial class Login : Form
14 {
15 public static string host, username, password;
16 public static int port;
17 public Login()
18 {
19 InitializeComponent();
20 this.DialogResult = DialogResult.Cancel;
21 BioLib.Settings.Load();
22 string h = BioLib.Settings.GetSettings("host");
23 string p = BioLib.Settings.GetSettings("port");
24 string u = BioLib.Settings.GetSettings("username");
25 if (h != "")
26 {
27 hostBox.Text = h;
28 host = h;
29 }
30 if (p != "")
31 {
32 portBox.Text = int.Parse(p).ToString();
33 port = int.Parse(p);
34 }
35 if(u != "")
36 {
37 usernameBox.Text = u;
38 username = u;
39 }
40 BioLib.Settings.AddSettings("username", usernameBox.Text);
41 BioLib.Settings.AddSettings("host", hostBox.Text);
42 BioLib.Settings.AddSettings("port", ((int)portBox.Value).ToString());
43
44 }
45
46 private void loginBut_Click(object sender, EventArgs e)
47 {
48 host = hostBox.Text;
49 username = usernameBox.Text;
50 password = passBox.Text;
51 port = (int)portBox.Value;
52 BioLib.Settings.AddSettings("host", hostBox.Text);
53 BioLib.Settings.AddSettings("port", ((int)portBox.Value).ToString());
54 BioLib.Settings.AddSettings("username", usernameBox.Text);
55 BioLib.Settings.Save();
56 this.DialogResult = DialogResult.OK;
57 this.Close();
58 }
59 }
60}
static string password
Definition Login.cs:15
static string host
Definition Login.cs:15
static int port
Definition Login.cs:16
static string username
Definition Login.cs:15