使用会话的 Windows Phone 7 Silverlight [英] Windows Phone 7 Silverlight using session

查看:28
本文介绍了使用会话的 Windows Phone 7 Silverlight的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 Windows 7 移动 Silverlight 项目.我使用 Rest api 进行身份验证,使用类说 Authentication.我得到一个身份验证令牌作为响应,并将它分配给一个类属性 AuthToken,因为我需要在不同的地方使用它.有什么方法可以将此 AuthToken 存储在会话或其他任何东西中.因为我在 wp7 中没有找到任何会话示例.谢谢

I am creating a Windows 7 mobile Silverlight project. I use Rest api for authentication using a class say Authentication. I get an authentication token as a response and I assign it to a class property AuthToken because I need to use this in different places. Is there any way to store this AuthToken in session or any thing else. Because I did not find any session example in wp7. Thanks

推荐答案

您没有找到任何会话示例,因为据我所知 WP7 没有会话.您应该能够使用隔离存储来保存您的 AuthToken.但是请记住,它不会像您对会话所期望的那样在一定时间后过期.

You're not finding any session examples because WP7 doesn't have session as far as I know. You should be able to use Isolated Storage to keep your AuthToken around. Bear in mind, however, that it wont expire after a certain amount of time like you'd expect with a session.

请参阅以下或谷歌搜索独立存储的示例:http://www.windowsphonegeek.com/tips/all-about-wp7-isolated-storage-store-data-in-isolatedstoragesettings

See the following or google search Isolated Storage for examples: http://www.windowsphonegeek.com/tips/all-about-wp7-isolated-storage-store-data-in-isolatedstoragesettings

希望有帮助.WP7开发不多,但对Silverlight比较熟悉.

Hope it helps. I haven't done a great deal of WP7 development, but I'm familiar with Silverlight.

这篇关于使用会话的 Windows Phone 7 Silverlight的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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