简体   繁体   English

使用ASP.Net在客户端永久存储数据

[英]Permanent Store DATA at client side using ASP.Net

I'm currently doing a POS ( Point of SALE ) project by using ASP.Net . 我目前正在使用ASP.Net做一个POSPoint of SALE )项目。 My web application works well when INTERNET is available to the client, but I'm trying to facilitate the client to use this web application even if the client doesn't have INTERNET connectivity. 当客户端可以使用INTERNET时,我的Web应用程序可以很好地工作,但是即使客户端没有INTERNET连接,我仍在尝试促进客户端使用此Web应用程序。

So, the tasks on which I did RND are: 因此,我执行RND的任务是:

  1. Launch Offline version of my web application, by creating a cache manifest file in HTML5 . 通过在HTML5创建缓存清单文件,启动我的Web应用程序的脱机版本。 So, client can get offline access to the web application when he has no internet connectivity (using CACHE.APPCACHE ) 因此,当客户端没有Internet连接时(使用CACHE.APPCACHE ),客户端可以脱机访问Web应用程序。
  2. Using HTML5 WebSql to store sale-data at client side, when internet is not available at client side. 当客户端无法使用Internet时,使用HTML5 WebSql在客户端存储销售数据。 And after that, this offline sale data(Local Sale Data) is synced to the live-database, when internet is connected. 之后,当连接互联网时,此脱机销售数据(本地销售数据)将同步到实时数据库。

But the issue is this, HTML5 Web Sql can be deleted by "deleting the Cookies and Content data" in browser. 但是问题是,可以通过在浏览器中“删除Cookie和内容数据”来删除HTML5 Web Sql So, all the sale-data , from Local Storage, can be deleted. 因此,可以删除本地存储中的所有sale-data Is there any other solution to store data at client side, so that Local Stored data can't be deleted by "deleting the Cookies and Content data" in browser. 还有其他解决方案可以在客户端存储数据,以便不能通过在浏览器中“删除Cookie和内容数据”来删除本地存储的数据。 Or can we store the LOCAL-Data into some kind of XML file instead of HTML5 WebSql ! 或者我们可以将LOCAL-Data存储到某种XML文件而不是HTML5 WebSql

  • Sale-Data = Data Storing when making a sale using POS Sale-Data =使用POS进行销售时的数据存储

  • Local Storage = Data storing at client side Local Storage =数据存储在客户端

  • Live Storage = Data Storing in Live DataBase Live Storage =实时数据库中的数据存储

You can save your data in xml file or text file when internet is not available and store that data to your data base when internet became available. 您可以在互联网不可用时将数据保存在xml文件或文本文件中,并在互联网可用时将数据存储到数据库中。 hence your data will be safe rather than using cookie because cookie can be deleted. 因此您的数据将比使用cookie更安全,因为可以删除cookie。

As answered by Nitin, saving Sale Data in XML file is a better way, and later you can push these data to your Live Storage. 正如Nitin回答的那样,将销售数据保存在XML文件中是一种更好的方法,以后您可以将这些数据推送到Live Storage。 And even CRUD operation is easy on XML files. XML文档甚至CRUD操作也很容易。 For more detail information, you can follow the below link- Best way to store data locally in .NET (C#) 有关更多详细信息,您可以按照下面的链接- 在.NET(C#)中本地存储数据的最佳方法

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM