public interface Iuser
{
void Reg(User user);
}
public class Userspre : Iuser
{
public void Reg(User user)
{
Console.WriteLine($"会员完成注册,姓名:{user.Name}密码:{user.Password}");
}
}
public class zsq_user : Iuser
{
private Iuser iuser;
public zsq_user(Iuser iuser)
{
this.iuser = iuser;
}
public void Reg(User user)
{
beifore();
iuser.Reg(user);
after();
}
private void beifore()
{ Console.WriteLine("在之前"); }
private void after()
{
Console.WriteLine("再之后");
}
}