Connecting to a Scanner with C# and other things C#

 I am still learning C# and wanted to write some code to connect to a scanner . I thought this should be simple . Man was I wrong . I first started searching the net on some really good tutorials to do this but couldn’t find any so I came across something on Codeproject.com which looked great but I’m really new to this stuff . Some of the stuff looked pretty self explanatory and others didn’t . I am going to try to expand on this in a different blog by showing the code . I had to use WIA (for the life of me right now I am not sure what it means Windows Integration Automation I think . ) Can anyone send me to a cool looking tutorial for newbies ?

What I basically wanted to do was write and app that took  a scanned document and put it into a SQL database . The reason was because you know how you get a lot of bills in the mail and other stuff . That stuff piles up on you after awhile . Not every company offers paperless bills lets say . So after awhile you get a ton of papers and if your like me than you probably don’t file things away as soon as you get it . I thought it would be nice to take that piece of paper and put it in the scanner hit a button to scan it in to your app . Then set some properties of the image . Then save it in a database . Which you can then sort your data and be able to print out what you want if you need it in the future .  Sounds pretty cool . I am learning allot this way about the language which is very power sitting atop .NET 🙂 .  I think of powershell the same way and that is extremely deadly with .net tied to it .

Also in C# I am having a tough time controlling the controls on my form from a class outside . For example :

on My main form there would be the Form Class

 Namespace WindowsApplication1

Public partial Class Form 1  

{

Lets say I have a button here

private button1_click()

{

}

}

Now I have a separate class with a method . How do I control that button from this separate Class ?

My other class is this for example :

Namespace MyotherClass{

Class MyotherClass 

{

Public static void GetNames()

{

….

From inside here I want to control the controls on form 1

}

}

}

Hope someone can help . I tried creating another instance of form1 but which seemed to work but couldn’t get the result I was looking for .

Advertisements