C#进阶 nSpring。

a315823806 2009-03-11 03:30:21
介绍一些c#方面的 spring资料。
即nspring。
...全文
327 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
a315823806 2009-04-18
  • 打赏
  • 举报
回复
多谢大家。一起学习!!!
lovebgh0923 2009-03-11
  • 打赏
  • 举报
回复
没用过,帮顶
wuyi8808 2009-03-11
  • 打赏
  • 举报
回复
确实没用过,呵呵。
wuyq11 2009-03-11
  • 打赏
  • 举报
回复
http://download.csdn.net/sort/tag/Spring
http://www.cnblogs.com/iloveu/archive/2009/02/11/1388649.html
http://www.cnblogs.com/buggavin/archive/2005/09/28/245922.html
huhan3 2009-03-11
  • 打赏
  • 举报
回复
参考一下吧。 http://topic.csdn.net/t/20061210/17/5220281.html

这东西用的人真不多,呵呵。
devilli 2009-03-11
  • 打赏
  • 举报
回复
不懂~
zzxap 2009-03-11
  • 打赏
  • 举报
回复


using System;
using System.Collections;
using OKEC.Sample.NHibernate.NHibernateTest;
namespace OKEC.Sample.Spring
{
/// <summary>
/// StartMain 的摘要说明。
/// </summary>
public class StartMain
{
public StartMain()
{ //
// TODO: 在此处添加构造函数逻辑
//
}
[STAThread]
static void Main()
{
//Startup Spring & NHibernate Content
SpringContext.init();

//Test Spring IOC
HelloTest test = (HelloTest)SpringContext.Context.GetObject("Hello");
test.Test();

//Test Spring & NHibernate
UserDao dao = SpringContext.Context.GetObject("UserDao") as UserDao;
User newUser = null;
try
{
newUser = dao.Load("joe_cool");
}
catch
{}
if(newUser==null)
{
newUser = new User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "joe@cool.com";
newUser.LastLogon = DateTime.Now;
// Tell NHibernate that this object should be saved
dao.SaveObject(newUser);
}
User joeCool = dao.Load("joe_cool");
// set Joe Cool's Last Login property
joeCool.LastLogon = DateTime.Now;
// flush the changes from the Session to the Database
dao.UpdateObject(joeCool);
IList recentUsers = dao.GetAllObjectsList();
foreach(User user in recentUsers)
{
//Assert.IsTrue(user.LastLogon > (new DateTime(2004, 03, 14, 20, 0, 0)) );
Console.WriteLine(user.UserName);
Console.WriteLine(user.Password);
}
Console.ReadLine();//让程序停留,回车关闭。
}
}
}
mingxiaodong 2009-03-11
  • 打赏
  • 举报
回复
我也没用过
jinjazz 2009-03-11
  • 打赏
  • 举报
回复
没用过,帮顶

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧