public string view_students(string co_code)
        {
            tmp.loadfile();
            tmp.string_edit();


            Console.Write("Enter the Course code :");
            string code;

            code = co_code;
            string s = "";

            for (int i = 0; i < tmp.objdata.Count; i++)
            {
                if (tmp.objdata[i].course_prog.Length > 6)
                {
                    List <string> cpl = new List <string>(); // courses progressed list.

                    string spl = "";


                    int count = -1;
                    while (true)
                    {
                        count++;
                        if (tmp.objdata[i].course_prog[count] == ' ')
                        {
                            cpl.Add(spl); spl = ""; continue;
                        }
                        spl += tmp.objdata[i].course_prog[count];
                        if (count == tmp.objdata[i].course_prog.Length - 1)
                        {
                            cpl.Add(spl); break;
                        }
                    }

                    for (int k = 0; k < cpl.Count; k++)
                    {
                        if (code == cpl[k])
                        {
                            s += tmp.objdata[i].name;
                            s += "     " + tmp.objdata[i].Id;
                            s += "\n";
                        }
                    }
                }
                else if (code == tmp.objdata[i].course_prog)
                {
                    s += tmp.objdata[i].name;
                    s += "     " + tmp.objdata[i].Id;
                    s += "\n";
                }
            }
            return(s);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            student s1 = new student();

            s1.loadfile();
            s1.string_edit();
            string X = textBox1.Text;
            string y = textBox2.Text;

            if (s1.login(X, y, ref index))
            {
                this.Hide();
                Form2 m = new Form2(index, s1);
                m.Show();
            }
            else
            {
                MessageBox.Show("Invalid username or password,Please check and try again !");
            }
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            student s1 = new student();

            s1.loadfile();
            s1.string_edit();
            string X = textBox1.Text;
            string y = textBox2.Text;

            if (X == "admin" && y == "admin")
            {
                this.Hide();
                Form8 m = new Form8();
                m.Show();
            }
            else
            {
                MessageBox.Show("Invalid username or password,Please check and try again !");
            }
        }