/// <summary> /// Обучает сеть /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { try { if (label4.Text == "") { using (var folder = new FolderBrowserDialog { Description = RU.Form1_button1_Click_Выберете_папку_с_картинками_для_обучения }) { if (folder.ShowDialog() == DialogResult.OK) { label4.Text = folder.SelectedPath; } } } if (!String.IsNullOrEmpty(label4.Text) && !String.IsNullOrWhiteSpace(label4.Text)) { _teachThread = new Thread(() => _teacher.Teach(LoadImage(label4.Text, 1), (Int32)numericUpDown1.Value)); _teachThread.Start(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public static void test() { Assembly assembly1 = Assembly.Load("Ite"); Type[] type = assembly1.GetTypes(); //foreach (var item in type) //{ // Console.WriteLine(item.Name+"\t\t"+item); //} //Console.ReadLine(); Type TeachType = assembly1.GetType(ObName); object obj = Activator.CreateInstance(TeachType, new object[] { 18, "邓缙柯", "朗诗" }); ITeacher tea = (Teacher)obj; tea.Teach(); Console.WriteLine(tea.WriteSomething()); Console.ReadLine(); }