如何将图像从网站复制到我的数据库. [英] How Can I Copy Image From Website to my database.

查看:68
本文介绍了如何将图像从网站复制到我的数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将图像从网站复制到数据库.就像我要复制书本图片一样 http://www.flipkart.com/books/8129115301?_l=PGmQtm+cu02kNJu4ekE+Dg--&_r=n_2yuAC4xgh0SZTuulvAtw-- .我想将该映像从该网站复制到我的数据库sqlserver.

致谢

苏曼

 


Shafiqul Alam

解决方案

从网站获取图像很容易,但是您需要直接链接到特定图像.您可以只使用picturebox的imagelocation属性来获取图像,然后将其从picturebox保存到数据库或保存到系统上的文件中.以下是示例 将显示在线图像的代码.

PictureBox4.ImageLocation =" http://img4.fkcdn.com/img/300/9788129115300.jpg "

要从数据库中插入和检索数据,请尝试下面的两个链接,这些链接都很容易理解

VB.NET http://support.microsoft.com/kb/308042

C#: http://www.redmondpie.com/inserting-in-and-retrieving-image-from-sql-server-database-using-c/

顺便说一句,要从网站获取图像路径,请右键单击该图像,然后从上下文菜单中选择属性,然后从属性窗口中复制地址(URL)前面的链接(这是针对IE的,可能与来自其他浏览器)

kaymaf

 

 


How Can I Copy Image from website to my database. Like if I want to copy a book image from http://www.flipkart.com/books/8129115301?_l=PGmQtm+cu02kNJu4ekE+Dg--&_r=n_2yuAC4xgh0SZTuulvAtw--. I want ot copy the image from this website to my database sqlserver.

Regards

Suman

 


Shafiqul Alam

解决方案

To get image from website is easy but you need the direct link to particular image. You can just use picturebox imagelocation property to get the image and then save the image to database from picturebox or save it to file on your system. Below is sample code that will display image from online.

PictureBox4.ImageLocation = "http://img4.fkcdn.com/img/300/9788129115300.jpg"

And to insert and retrieve data from database, try these links below both are easy to understand

VB.NET http://support.microsoft.com/kb/308042

C#: http://www.redmondpie.com/inserting-in-and-retrieving-image-from-sql-server-database-using-c/

By the way, to get image path from website, right click the image and select properties from context menu, from properties window, copy the link in front of Address (URL) ( this is for IE, it may be differ from from other browsers)

kaymaf

 

 


这篇关于如何将图像从网站复制到我的数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆