阅读c#.net 2010中.jpeg图像文件中的内容 [英] read the contant in .jpeg image file in c#.net 2010

查看:80
本文介绍了阅读c#.net 2010中.jpeg图像文件中的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用c#.net读取.jpeg图像文件中的内容,然后在sql server 2005中保存sel

ect的内容。

解决方案

如果要在图像中检测并读取文本,则称为光学字符识别,或短暂的OCR。有一些库可用于此目的。

如果您有特殊要求(例如一些印度字母而不是英文),请确保选择一个也支持该库的库。


如果您想要从FileUpload中读取内容。然后按照下面的说明:



.aspx:



< asp:fileupload id =FileUploadControlrunat =serverxmlns:asp =#unknown>





.cs:



protected void read_image()

{

  if (FileUploadControl.HasFile)



{

Image_Bytes bytes [] = FileUploadControl.FileBytes;

//然后通过SQL连接将字节值传递给数据库表

}





在SQL Server中:



CREATE TABLE Image_Bytes



Image_ID INT PRIMARY KEY,

Image_Bytes IMAGE





使用类型作为图像来保存从.cs页面获得的图像字节。



请告诉我这就是你要找的东西!!!

Happy Coding :))

i need to read the contant in .jpeg image file using c#.net and save the sel
ected contant in sql server 2005.

解决方案

If you want to detect and read text in an image, that's called Optical Character Recognition, or shortly OCR. There are some libraries available for that purpose.
If you have special requirements (e.g. some Indian alphabets instead of English), make sure that you select a library which supports also that.


If you want to read the content from FileUpload. then follow the below :

.aspx :

<asp:fileupload id="FileUploadControl" runat="server" xmlns:asp="#unknown">


.cs :

protected void read_image()
{

if(FileUploadControl.HasFile)


{
Image_Bytes bytes[] = FileUploadControl.FileBytes;
// Then pass the bytes value to your database table through your SQL connection
}


In SQL Server :

CREATE TABLE Image_Bytes
(
Image_ID INT PRIMARY KEY,
Image_Bytes IMAGE
)

Use the type as IMAGE to save the image bytes you get it from .cs page.

Please let me know is this what you are searching for !!!
Happy Coding :)


这篇关于阅读c#.net 2010中.jpeg图像文件中的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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