Use the browser to open the phone number Query Web site, with the above steps to find the address of his call, and finally write code as follows:
code is as follows
using System
using System.Windows.Forms;
using System.Xml;
namespace Hnvote
{
& nbsp; public partial class Mobile:form
{
& nbsp Public Mobile ()
{
InitializeComponent ();
}
private Static string[] Getmobileinfo (string number)
{
try
{
XmlDocument xmldocument = new XmlDocument ();
XmlDocument. Load ("http://api.showji.com/Locating/default.aspx?m=" + number);
XmlNamespaceManager cx = new XmlNamespaceManager (xmldocument.nametable);
CX. AddNamespace ("Content", "http://api.showji.com/Locating/");
XmlNodeList Nodes = xmldocument.selectnodes
("//content:queryresult|//content:mobile|//content:province|//content:city|//
Content:corp|//content:card|//content:areacode|//content:postcode ", CX);
if (nodes. Count = 8)
{
if ("True"). Equals (Nodes[1]. innertext))
{
return new string[]
{
Nodes[0]. InnerText, nodes[2]. InnerText, Nodes[3]. InnerText, Nodes[4]. InnerText,
NODES[5]. InnerText, Nodes[6]. InnerText + nodes[7]. InnerText
};
}
}
return new string[] {"false"};
}
catch (Exception)
{
return new string[] {"false"};
}
}
private void Button1_Click (object sender, EventArgs e)
{
Try
{
string[] num = Getmobileinfo (TextBox1.Text);
MessageBox.Show ("Search number:" + num[0] + "N Attribution Province:" + num[1] + "N Attribution City:" + num[2] + "N City Code:" + num[3] + "N City Zip Code:" +
Num[4] + "n Card type:" + num[5], "Query results", MessageBoxButtons.OK, Messageboxicon.informatio n);
}
catch (Exception ex)
{
MessageBox.Show (ex. Message, "error hint", messageboxbuttons.ok,messageboxicon.warning);
}
}
private void Textbox1_keydown (object sender, KeyEventArgs e)
{
if (e.keycode==keys.enter)
{
button1_click (sender,e);
}
}
}
}
Interface: