Windows phone 7 如何将加号传递到Windows phone的下一页

Windows phone 7 如何将加号传递到Windows phone的下一页,windows-phone-7,Windows Phone 7,问题:我想把带加号的手机号码转到下一页。但是只有手机号码没有加号 非常感谢你的帮助 txtMobile1.text = "+61912345678" if (chk1.IsChecked.Value) { NavigationService.Navigate(new Uri("/SendMsg.xaml?fn=" + HttpUtility.UrlEncode(txtMobile1.Text) + "&Name=" + strName, UriKind.Relative));

问题:我想把带加号的手机号码转到下一页。但是只有手机号码没有加号

非常感谢你的帮助


txtMobile1.text = "+61912345678"

 if (chk1.IsChecked.Value)
  {
 NavigationService.Navigate(new Uri("/SendMsg.xaml?fn=" +  HttpUtility.UrlEncode(txtMobile1.Text) + "&Name=" + strName, UriKind.Relative));

  }


---- Receiving:

  if (NavigationContext.QueryString.ContainsKey("fn"))
  {
  strPassInMobileNo = HttpUtility.UrlDecode(this.NavigationContext.QueryString["fn"]) ;

   }

The received mobile phone no is : 61912345678  without the puls sign


使用
HttpUtility.HtmlDecode(this.NavigationContext.QueryString[“fn”])

未解码的结果是什么样的?这个.NavigationContext.QueryString[“fn”]?哦,如果不使用下面ChristiaanV提供的解决方案,它将传递整个移动电话,即:+61912345678,在接收端,它在文本框上显示61912345678。我做了一个检查,有一个空格字符或一些字符,但在61912345678前面看不到。在发送部分:我是否使用httpUtility.HtmlEncode(txtMobile.text)?它不起作用?在发送部分可以使用HttpUtility.UrlEncode(txtMobile.text),在接收部分可以使用HttpUtility.HtmlDecode()谢谢。它起作用了。但是为什么要使用不同的httputilty方法呢?我想我正在通过查询字符串,因此使用URLEncode。ThankshtPutibility.UrlEncode用于编码完整的url,包括域名、查询字符串值等。因此,因为您只编码查询字符串值,所以HttpUtility.HtmlEncode也可以工作。