Beispiel #1
0
        private void SetConnString()
        {
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);

            connStringPath = appPath + "\\connString.txt";

            if (!File.Exists(connStringPath)) //file not exists
            {
                System.IO.FileStream fs = System.IO.File.Create(connStringPath);

                Forms.fConnection fconn = new Forms.fConnection(this);
                fconn.MdiParent = this;
                fconn.Show();
            }
            else //file exists
            {
                string[] lines = System.IO.File.ReadAllLines(connStringPath);

                if (lines.Count() < 1)
                {
                    Forms.fConnection fconn = new Forms.fConnection(this);
                    fconn.MdiParent = this;
                    fconn.Show();
                }
                foreach (string line in lines)
                {
                    // Use a tab to indent each line of the file.
                    Form1.connString = String.Empty;
                    Form1.connString = line;
                }

                UpdateHUD();
            }
        }
Beispiel #2
0
        private void konekcijaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Forms.fConnection fconn = new Forms.fConnection(this);
            fconn.MdiParent = this;
            fconn.Show();

            lblconnection.Text = Form1.connString;
        }