public interface Iprogramer
{
void WriteCode();
}
class clsVBProgramer : Iprogramer
{
public void WriteCode(){
MessageBox.Show("VB程序员");
}
}
class clsCProgramer : Iprogramer
{
public void WriteCode() {
MessageBox.Show("C程序员");
}
}
class clsProject
{
public void WriteProgram(Iprogramer cProgramer)
{
cProgramer.WriteCode();
}
}
//-----
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
clsCProgramer cProgramer = new clsCProgramer();
clsVBProgramer vbProgramer = new clsVBProgramer();
clsProject newProject = new clsProject();
newProject.WriteProgram(cProgramer);
newProject.WriteProgram(vbProgramer);
//Application.Run(new Form1());
}