在整个重新启动preserving ASP.NET应用程序状态 [英] Preserving ASP.NET Application State Across Restarts

查看:236
本文介绍了在整个重新启动preserving ASP.NET应用程序状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么好办法跨越重启preserve ASP.NET应用程序状态?

我希望能够设置一些值重新启动应用程序,并让他们依然存在。 我想主要是这样做的小用完即弃的测试网络的甚至不需要一个数据库应用程序。

有一些方法与静态成员,系列化办呢? Web缓存?

更新
应用程序应该能够更新这些值。
值可以是自定义的对象,如:

 公共类Person
{
  公共字符串名字{获得;组; }
  公共字符串名字{获得;组; }
}
 

解决方案

您需要某种形式的持久化数据存储,不管是数据库,XML文件或其他什么东西。

您可能会感兴趣,其中获得pretty的接近 SimpleRepository与SqlLite从亚音速以你的描述。

Any good way to preserve ASP.NET Application state across restarts?

I want to be able to set some values restart the app and have them still be there. I want to primarily do this for small "throw-away" test web apps that don't even need a database.

Is there some way to do it with static members and serialization? web cache?

UPDATE:
Application should be able to update these values.
Values could be custom objects like:

public class Person    
{  
  public string FirstName { get; set; }  
  public string LastName { get; set; }      
}

解决方案

You need some sort of persistent data storage, whether that's a database, xml files or something else.

You might be interested in the SimpleRepository with SqlLite from SubSonic which gets pretty close to what you describe.

这篇关于在整个重新启动preserving ASP.NET应用程序状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆