static void Main(string[] args) { //初始化容器 IApplicationContext ctx = ContextRegistry.GetContext(); IUserInfoDal dal = ctx.GetObject("UserInfoDal") as IUserInfoDal; dal.show(); Console.ReadKey(); }