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

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

问题描述

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

我有两个文本框:usernamepassword现在我在那些 textboxes 上输入值,这些值例如:

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

现在我想要多个页面中的这些值,那怎么可能呢?我正在使用查询字符串,但每次我必须使用 navigation URI 定义值时,所以请给我建议任何其他方式,如 ASP.NET 中的 SESSION.

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 中创建会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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