摘要: 使用前要导入SQLDMO.dll(在com组件中导入Microsoft SQLDMO Object Library即可)/// /// DbOper类,主要应用SQLDMO实现对Microsoft SQL Server数据库的备份和恢复 /// public sealed class DbOper { /// /// DbOper类的构造函数 /// public DbOper() { } /// /// 数据库备份 /// ... 阅读全文
posted @ 2013-02-25 20:25 踏浪帅 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 最近在学习spring.net 接下来将实现一个与我们普通三层结合的实例!简单了解一下spring.net的运用;该项目共分四层;接口层IClassLibrary 被BLL 及DAL层引用;层;BLL不引用DAL 因为我们这用spring.net来加载;BLL引用的spring.net所要的DLL配置文件在UI我们首先来看一下接口层两个类的代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace IClassLibrary{ public interface... 阅读全文
posted @ 2013-02-25 20:16 踏浪帅 阅读(2735) 评论(3) 推荐(2) 编辑
摘要: 多数情况下,容器会根据对象定义中的type属性值去直接调用相应类型的某个构造器。另外,还可以调用工厂方法来创建对象。(Spring.net中文手册)实例参考。(1) Order类namespace IocTest.Entities{ public class Order { public int Unid { get; set; } public string OrderName { get; set; } public string UserId { get; set; } public override string ToString() { return OrderName + &quo 阅读全文
posted @ 2013-02-25 10:01 踏浪帅 阅读(363) 评论(0) 推荐(0) 编辑
摘要: (一)物理路径(可以复制)IResource input = new FileSystemResource(@"self.xml");IObjectFactory fac = new XmlObjectFactory(input);(二)程序集方法url语法:file://文件名(复制) assembly://程序集名/命名空名/文件名(嵌入)IApplicationContext context = new XmlApplicationContext("file://self.xml");IObjectFactory fac = (IObjectFac 阅读全文
posted @ 2013-02-25 09:56 踏浪帅 阅读(303) 评论(0) 推荐(0) 编辑