[求高手帮忙]WinForm下如何读取网络的图片 现在做的程序要打印学生的成绩单,但学生的照片保存在服务器上,而本地的WinForm打印,请问怎么读取到图片?asp.net下的读取已经会了,就是获得物理地址,使用FileStream读取数据成二进制流。但是现在是网络地址的图片,请问该怎么读取成二进制呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用webBrowser控件吧通过它返回网页的内容,然后取你想要的东西 使用WebClient下载图片后,再显示:try{ WebClient webClient = new WebClient(); webClient.DownloadFile("http://localhost/mynewsreader/dingdang.png", "dingdang.png"); picShow.Image = Image.FromFile("dingdang.png");}catch (Exception ex){ MessageBox.Show(ex.ToString());} 汗,是net4.0的,我们现在开发的还是2.0,因为4.0不能用原来的水晶报表了。很多东西不想改。不过谢谢了。 http://topic.csdn.net/u/20120818/12/8233f600-3601-4792-b104-9d45a225cc56.html是需要我最后发表的东西? try{ WebClient webClient = new WebClient(); webClient.DownloadFile("http://localhost/mynewsreader/dingdang.png", "dingdang.png"); picShow.Image = Image.FromFile("dingdang.png");}catch (Exception ex){ MessageBox.Show(ex.ToString());} 其实问题有点复杂了。如果图片是jpg格式的,就可以用读取到本地再转换的方法,现在问题麻烦了,是因为在网页端存的是aspx格式的图片,用webclient的时候,被IIS直接解析了,我晕。我再找找解决方案。 查询数据的时候怎么样使用线程 这段代码什么意思 C#能不能监听到电脑上的文件夹被打开? 关于利用setupapi.dll枚举硬件设备时隐藏设备的识别 SMS短消息PDU编码与解码 对用LINQ TO Dataset从数据表中检索出来的记录,编辑更新后能不能反映到检索的数据源中 listview问题 关于正则表达式的匹配 win form UI中写入数据怎么不能出现在数据库中呀?测试代码没有任何问题?望达人帮下谢谢 怎么添加PlotView控件? c#网络编程问题 如何给WPF中的DataGrid取得焦点的单元格赋值
通过它返回网页的内容,然后取你想要的东西
try
{
WebClient webClient = new WebClient();
webClient.DownloadFile("http://localhost/mynewsreader/dingdang.png", "dingdang.png");
picShow.Image = Image.FromFile("dingdang.png");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
汗,是net4.0的,我们现在开发的还是2.0,因为4.0不能用原来的水晶报表了。很多东西不想改。不过谢谢了。
{
WebClient webClient = new WebClient();
webClient.DownloadFile("http://localhost/mynewsreader/dingdang.png", "dingdang.png");
picShow.Image = Image.FromFile("dingdang.png");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}