http://www.cnblogs.com/xiaosheng/archive/2005/06/09/171399.html第一个简单的Sprint.net例子 第一个简单使用Spring.net的例子目的是把一个简单的类通过反转注入为一个实例.练习基本的config配置需要反转的类: using System;namespace SpringTest App.config里的配置 <?xml version="1.0" encoding="utf-8"?><configuration> <configSections> <sectionGroup name="spring"> <section name="context" type="Spring.Context.Support.ContextHandler,Spring.Core"/> <section name="objects" type="Spring.Context.Support.DefaultSectionHandler,Spring.Core"/> </sectionGroup> </configSections> <spring> <context> <resource uri="config://spring/objects"/> </context> <objects> <object name="MyUser" type="SpringTest.User,SpringTest"> <constructor-arg name="name" type="string"><value>Tommy</value></constructor-arg> <constructor-arg name="age" type="int"><value>20</value></constructor-arg> </object> </objects> </spring></configuration> 具体调用Sprint实现代码: using System;using System.Configuration;using log4net.Config;using Spring.Context;namespace SprintTest} 相关文章: