Click here to Skip to main content
13,346,480 members (61,456 online)
Click here to Skip to main content
Add your own
alternative version


77 bookmarked
Posted 29 May 2005

.NET Web Twain

, 29 May 2005
Rate this:
Please Sign up or sign in to vote.
Web twain.

Sample Image - Web_Twain.jpg


Simply I want to use scanner in client side in DMS (Document Management System) web application. I have searched the Internet for solution but I found it very expensive for me so I decided to write a free one.


I found some articles in CodeProject like .NET TWAIN image scanner By NETMaster. That's nice. That is my goal:

  1. Rewrite NETMaster's application to be in one Windows form, make it automated and find way to deploy it in web page.
  2. Call this application from your web page.
  3. Upload the acquired image to server in simple way.

step 1:nop

step 2:You can use JavaScript to do it.

<input onclick="'file:///C:/TZTwain/TZTwain.exe',1);"
           type=button value=Scan>

But this code will not work with Windows XP sp2 :( So use this one:

<input onclick=runApp() type=button value="Scan XP sp2 users" name=button1>
<script language="javascript" type=text/javascript>
function runApp() 
  var shell = new ActiveXObject("");"c:\\tztwain\\tztwain.exe", 1, true); 

Step 3: You can use FTP or simply web service like me.

Sample App

  1. Configure testScan and FileUploadWS in IIS.
  2. FileUploadWS: Change save location.
    string filePath=Server.MapPath(@"..\testscan\upload\j2.jpg");
  3. TestScan: gives write permission to users (ASP.NET, IWAM and IUSR) at upload folder.
  4. Change web reference in testdotnettwain to localhost. Then build it and ZIP the exe file with winrar and make it sfx (with these options).
    Overwrite=1) then put the tztwain.exe in c:\inetpub\wwwroot\testScan.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Taha Amin
Egypt Egypt
Senior Development Manager, with 11 years of experience. Focused on design/developing/delivery B/OSS modules to satisfy customer/business requirements in accordance to TM Forum's TAM/SID framework. Excellent communication and interpersonal skills, flexibility, ability to adjust to new people and situations, strong problem solving skills and willing to work effectively and efficiently. Gained additional leadership skills such as: - High effective mentorship and coaching - Clearly communication and solutions sharing with my team - Decision making

You may also be interested in...

Comments and Discussions

Taha Zayed24-Jul-06 23:33
memberTaha Zayed24-Jul-06 23:33 
Generalexception in txtwain.exe Pin
KHALIYA4-Jul-06 3:21
memberKHALIYA4-Jul-06 3:21 
GeneralScanner Pin
ghannam12-Jun-06 2:42
memberghannam12-Jun-06 2:42 
GeneralNot closing application Pin
i0002471-Jun-06 2:25
memberi0002471-Jun-06 2:25 
GeneralRe: Not closing application Pin
mroginski3-Sep-08 5:01
membermroginski3-Sep-08 5:01 
Generalscan thru asp Pin
xlt20-May-06 7:33
memberxlt20-May-06 7:33 
Generalnice solution----problem with the resolution Pin
zhidsuk13-Feb-06 10:18
memberzhidsuk13-Feb-06 10:18 
GeneralNice ! Pin
Tareq_Gamal16-Jan-06 0:43
memberTareq_Gamal16-Jan-06 0:43 
Hello Taha , I'm Tare gamal from egypt , I hope i see all egyptians like u,
any how Perfect artical , I am reading your one about web cam and motion detiction because i'd like to make a security system at home Wink | ;)

Questionwhere is comments? Pin
Taha Zayed31-May-05 0:46
memberTaha Zayed31-May-05 0:46 
AnswerRe: where is comments? Pin
LaMagra31-May-05 22:52
memberLaMagra31-May-05 22:52 
GeneralRe: where is comments? Pin
MaxJam1-Jun-05 1:35
memberMaxJam1-Jun-05 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 29 May 2005
Article Copyright 2005 by Taha Amin
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid