上次的文章http://www.sufeinet.com/forum.php?mod=viewthread&tid=213没有具体 说完,这里再加上一点,就是把得到的结果取出来
[C#] 纯文本查看 复制代码 //转图片的方法
public Image Base64ToImage(string base64String)
{
byte[] imageBytes = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(imageBytes, 0,
imageBytes.Length);
ms.Write(imageBytes, 0, imageBytes.Length);
System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true);
return image;
}
//取返回的信息结果
private void button4_Click(object sender, EventArgs e)
{
XmlDocument objXml = new XmlDocument();
//文件在Bin目录下
objXml.Load(Application.StartupPath + "\\XML.xml");
//身份证号
textBox1.Text = objXml.SelectSingleNode("//gmsfhm").InnerText;
//姓名
textBox2.Text = objXml.SelectSingleNode("//xm").InnerText;
//身份证号是否一样
textBox4.Text = objXml.SelectSingleNode("//result_gmsfhm").InnerText;
//姓名是否一样
textBox3.Text = objXml.SelectSingleNode("//result_xm").InnerText;
//取图片
string bas64 = objXml.SelectSingleNode("//xp").InnerText;
//显示图片
pictureBox1.Image = Base64ToImage(bas64);
}
|