private void btn_anslut_Click(object sender, EventArgs e) { ip = tbx_ip.Text; datacenter.connect(ip); FileStream fs = new FileStream("IP.txt", FileMode.Open, FileAccess.Write); StreamWriter stw = new StreamWriter(fs); if (datacenter.connected) { f.Start(); f.EnableData(true); stw.WriteLine(ip); } stw.Close(); Close(); }
public Form1() { InitializeComponent(); DataBase = new DataCenter(); FileStream fs = new FileStream("IP.txt", FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs); string ip = sr.ReadLine(); Console.WriteLine(ip); DataBase.connect(ip); sr.Close(); fs.Close(); // Bild = DataBase.GetImage(1,"png"); // pbx_BildBox.Image = Bild; Start(); }