我撰写了一个方案,向特定地点发出要求并做出回应。 它与当地东道方适当运作,但如果是www.google.com的话,它就会造成错误,因为“复发的错误:不是创立的”。
<><><>>>><>>>>>>*** ∗∗∗∗∗∗
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.IO;
namespace WindowsPhoneApplication2
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
var request = (HttpWebRequest)WebRequest.Create(new Uri(@"http://www.google.com"));
request.BeginGetResponse(r =>
{
var httpRequest = (HttpWebRequest)r.AsyncState;
var httpResponse = (HttpWebResponse)httpRequest.EndGetResponse(r);
using (var reader = new StreamReader(httpResponse.GetResponseStream()))
{
var response = reader.ReadToEnd();
Deployment.Current.Dispatcher.BeginInvoke(new Action(() => { textBox1.Text = response; }));
}
}, request);
}
}
}
please tell me soultion thanx in advance