using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApp
{
public partial class ExFunction : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AA aa = new AA() { Code="zzy" };
this.Label1.Text=aa.GetName();
}
}
public interface IFun
{
string Code {get;set; }
}
public class AA : IFun
{
public string Code { get; set; }
}
public class BB : IFun
{
public string Code { get; set; }
}
public static class CC
{
public static string GetName(this IFun fun)
{
return fun.Code + "XXX";
}
}
}

浙公网安备 33010602011771号