示例#1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Admin  Ad = new Admin();
            string s  = Ad.view_students(textBox1.Text);

            if (s == "")
            {
                MessageBox.Show("Sorry,No students in this course");
            }
            string g = "";

            for (int h = 0; h < s.Length; h++)
            {
                if (s[h] == '\n')
                {
                    listBox1.Items.Add(g); g = ""; continue;
                }
                g += s[h];
            }
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Admin  Ad = new Admin();
            string s  = Ad.view_students(textBox1.Text);

            if (Ad.code_in == 0)
            {
                label2.Text = "Wrong code !";
                label2.Show();
            }
            else
            {
                string g = "";
                for (int h = 0; h < s.Length; h++)
                {
                    if (s[h] == '\n')
                    {
                        listBox1.Items.Add(g); g = ""; continue;
                    }
                    g += s[h];
                }
            }
        }