こんにちは、私はウェブサービスからデータを取得する必要があります&それらをテキストブロックに入れてください。次のコードで空のテキストブロックを表示します。コードに問題がありますか? ????ウェブサービスのテキストブロックデータ
public info()
{
InitializeComponent();
WebClient inf = new WebClient();
// client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
inf.DownloadStringCompleted+=new DownloadStringCompletedEventHandler(inf_DownloadStringCompleted);
//name.Text =
}
public void inf_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string pass = mp.passwordBox1.Password;
string id = mp.tx.Text;
string url = "http://82.212.89.6:888/mob/resources/stdInfo/authenticate/" +id + "/" +pass + "/1/570322308ce1121cba1b93f5acc9ebd4733ef2bca90ef942a2cfa224f0aa08dc/1";
XElement xx = XElement.Parse(url);
string m= xx.Element("userId").Value;
name.Text = m;
}
が見えます。 – reinierpost
'xmlreader'を使用して結果を読み込み、その内容を解析します。 –
私はxmlreaderからオブジェクトを定義し、それを任意のクラスオブジェクトとして使用して値を呼び出します。 –