如何在Windows Phone中创建SESSION [英] How to create SESSION in Windows Phone

查看:196
本文介绍了如何在Windows Phone中创建SESSION的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string uname = txt1.Text;
string pwd = txt2.Text;
NavigationService.Navigate(new Uri("/newPage.xaml?name="+uname+"&pwd="+pwd,UriKind.Relative));

我有两个文本框: username password
现在我在文本框上输入值,这些值例如:

I have two text boxes: username and password now I am entering values on those textboxes and those values are for example:

username: abcd
password:1234

现在我想在多个页面中的那些值,那么怎么可能呢?
我使用查询字符串,但每次我必须定义值与导航URI
所以请建议我任何其他方式像SESSION在ASP。 NET。

now I want those values in multiple pages, so how it will possible? I am using query string but every time I have to define values with navigation URI, So please suggest me any other way like SESSION in ASP.NET.

推荐答案

登录成功后,您可以将用户名和密码复制到静态变量,

Once the login is success, you can copy the Username and Password to static variables which have same namespace as of the app so that it will be accessible in every pages.

public static string Username;
public static string Password;

希望这会解决您的问题

这篇关于如何在Windows Phone中创建SESSION的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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