阅读全文:http://www.cckan.net/forum.php?mod=viewthread&tid=214
上次的文章http://www.cnblogs.com/sufei/archive/2010/03/14/https.html没有具体 说完,这里再加上一点,就是把得到的结果取出来
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
//
转图片的方法
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);
}
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);
}