如何获取以前的请求值 [英] How to get a Previous request value

查看:85
本文介绍了如何获取以前的请求值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我正在调用WebService并从代码中获取双倍值。



Hi Everyone

I am calling a WebService and getting a double value from below code.

double exchangevalue = exchangerate.ConversionRate(CurrencyExchange.Currency.INR, CurrencyExchange.Currency.AED);





一旦我连接到互联网,我就会从webService获得双倍价值并做我的工作。



假设我没有连接到互联网,所以我不会从前一行代码获得价值,因为它无法调用webservice.So我想从之前的请求中获取值。

那么如何存储以前的请求值,以便我可以在我的互联网连接关闭时使用该值。



任何类型的帮助都将受到赞赏。



Once i am connected to Internet i am getting the double value from webService and doing my stuff.

Suppose i am not connected to Internet,so i will not get value from the previous line of code,because it can't call the webservice.So i want to get the value from previous request.
So how to store the previous request value so that i can use that value when my Internet connection is off.

any kind of help will be appreciated.

推荐答案

只是合乎逻辑:如果您没有连接到Web服务,它甚至不存在。如果您已经完成了一些先前的请求并获得了响应,那么它就会消失,除非您将其存储在客户端代码中的某处。你是如何做到的,你究竟存储了什么,你想要存储多长时间的请求历史 - 这完全取决于你。



-SA
Just be logical: if you don't have a connection to a Web service, it does not even exist for you. If you have done some previous request and obtained the response, its gone, unless you store it somewhere in your client code. And how you do it, what exactly you store, how long request history you want to store — this all is totally up to you.

—SA


嗯,您提到要使用上一个值,而不是从Web服务获取值,将其存储在客户端的某个位置。存储它有很多选项。



当你没有互联网连接时,获取存储的值并执行操作。当你获得互联网连接时,获得价值再次通过替换已经存储的更新它。



问候......:笑:
Well,you mentioned that you want to use 'Previous value',than when you get value from web service,store it somewhere at client. There are so many options for storing it.

When you dont have internet connection,get the stored value and perform the operation.When you get the internet connection,obtain value again and update it by replacing the already stored one.

Regards..:laugh:


这篇关于如何获取以前的请求值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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