离线存储数据asp.net [英] store data offline asp.net

查看:78
本文介绍了离线存储数据asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要一种在脱机时保存数据的方法,如果您给出一个想法,即当用户没有网络连接并且需要输入数据时如何处理用户,这将是一个很好的选择.当网络连接出现时,他们可以将脱机数据下沉到联机状态.

问候

Manoj Sharma

Hi,

i need a ways to save data while offline, it would just be nice if you give the Idea that how the users in case they are without a network connection and have data they need to enter. And when thay come network connection they can sink offline data to online.

regards

Manoj Sharma

推荐答案

首先,您可以在会话中存储此数据,而当您在线时,您可以将其存储在DB中.
first you can store this data in session and when you are online at that time you can store in DB.


http/ASP.net是一个已连接的协议和环境,因此如果您的连接断开,它将无法正常工作.

另外,由于它是在Web浏览器的沙盒"主机中运行的,因此您无法将数据保存到客户端计算机(在某种程度上,您可以使用Cookie等).

如果您需要离线存储,请尝试使用html5.
http/ASP.net is a connected protocol and environment so if your connection goes down it will not work.

Also because it is run in a "sandboxed" host of a web browser you cannot save data to your clients computer (you can in a limited sense in cookies etc.).

If you need offline storage try looking into html5 instead.


在网络上这几乎是不可能的,主要是因为您正在编写一个本质上需要通过网络访问的网站.而不是使用ASP.Net,您应该研究编写Win Forms应用程序.然后,有两个数据库或文件系统,一个在服务器上运行,一个在用户计算机上设置.然后,执行与大多数笔记本电脑到网络计算机相似的技巧-每次用户连接时,仅复制绝对必要的文件-即,仅更新文件,而实际上是用户将要访问的文件,而不是别人的文件.如果您正在使用数据库数据,则只需跨数据库进行复制(除非您的数据库变得非常大,此时您应该考虑仅复制必要的位,但这比您最初需要的阶段要先进得多).用户登录时,在保存内容时,请将其复制到服务器.当用户首次连接时确实是很难的:

并发问题:-Google It!
这里没有足够的空间来完全解释这些问题,实际上没有完美的解决方案-尽您所能或在您所处的环境中发挥最佳作用.我建议(首先)当用户首次登录时,将所有修改过的文件复制到服务器上,但只复制比服务器上最近修改过的文件.

希望这会有所帮助,

埃德:)
Through the web this is almost impossible to do, mostly because you''re writing a website that inherently needs to be accessed over the web. Instead of using ASP.Net you should look at writing a Win Forms application. Then, either have two databases or file systems, one running on your server and one set up on the users computer. Then do a similar trick to what most laptops-to-network computers do - each time the user connects, copy across ONLY THE ABSOLUTELY NECESSARY FILES - i.e. only the files that have been updated and only ones that the user is actually going to access, not someone else''s documents for example. If you''re using database data then simply copy the database across (unless your database grows very big at which point you should consider only copying the necessary bits but that''s a stage more advanced than you need initially). While the user logs on, when they save something, copy it to the server. When the user firsts connects is the hard bit really:

Concurrency Issues: - Google It!
There is not space here to fully explain these issues and indeed there is no perfect solution - do what you thinks best or works best in your situation. I advise (as a start) when user first logs on, copy all modified files to the server but only ones that were modified more recently than those on the server.

Hope this helps,

Ed :)


这篇关于离线存储数据asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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