HttpRequest访问Https带有证书并使用WSDL文档生成代理类方案(2)
2010-03-16 16:54 苏飞 阅读(2779) 评论(4) 编辑 收藏 举报阅读全文:http://www.cckan.net/forum.php?mod=viewthread&tid=214
上次的文章http://www.cnblogs.com/sufei/archive/2010/03/14/https.html没有具体 说完,这里再加上一点,就是把得到的结果取出来
代码
//转图片的方法
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);
}
本人的博客不再维护从2013年就不再维护了
需要我帮助的朋友请到我的个人论坛 http://www.sufeinet.com 进行讨论,感谢大家对我的支持!