views:

1501

answers:

5

I'm looking to screen scrape a 3270 mainframe application in C#, but I've got to do so without Attachmate or other 3rd party plugins. Are there free managed libraries to do so in C#?

A: 

I'm going to operate under two assumptions here.

  1. By screen scraping you not only mean getting a screen shot but then deciphering text and other items on the screen.
  2. You can't use 3rd party utilities because you don't want to install them on the system.

It makes zero sense to try to write your own OCR stuff and any other approaches to grabbing data off a mainframe app are going to be buggy at best. If I were you, I would write a C# app that grabs a screen shot and sends it to a web service. The web service uses a 3rd party utility to screen scrape the screen shot and sends back the appropriate data to the application.

Spencer Ruport
A: 

Screen Scraping is a term that is used for apps that grab characters from a console by screen location, and implicitely implies that you already have a Terminal Emulator that you are using to display the screens, most (all?) of those terminal emulators will have an API to allow you to do that without any additional 3rd part components (usually via COM or straight DLL's calls)

However if you are talking about also Emulating the Terminal yourself....

There is a huge amount of work in Terminal Emulation, it would easily cost you more in effort than simply using a tool, but if you are dead set in rolling your owm, there are a lot of open source implementations that you could grab the source to and grok at their implementation PuTTY is probably nowdays almost a defacto standard. (I don't know what it's written in I suspect C/C++, but if you understand the concepts of it would be easy enough to port to C#, PuTTY does suport 3270)

Tim Jarvis
A: 

Wow, back in the days we used SNA Server for stuff like this. To do all the jumps and hurdles around protocols you could leverage BizTalk Host Integration Server 2009 for this type of stuff. There is a defunt CodePlex project:

http://www.codeplex.com/Open3270 http://www.open3270.net/

But it's gone nowhere in 3 years.

The closes you may get is this:

http://www.codeproject.com/KB/cs/all%5Fehllapi.aspx

Nissan Fan
That http://www.open3270.net/ link is worse than dead... its now the home of "Dr. Pooter treats computers."
Robert
+1  A: 

http://www.elink.ibmlink.ibm.com/publications/servlet/pbi.wss?CTY=US&FNC=SRX&PBL=GA23-0059-07

This is the document you are looking for if you plan on doing all of the heavy lifting yourself. It doesn't print out well but is the best source of information on the protocol.

I am about to embark on this road myself (thanks to the federal government) and in less than two weeks I intend to have a completed application. I don't want to do it, but my parameters state I do not use any third party applications as well. Mine will be in C# as well.

I would invite you to email me if you'd like my source, but I must warn you, I will not give it away for free. I know you are looking for free.

Andrew
This is completed, by the way. 643 lines of C# code.
Andrew
A: 

I have a full c# library (.net 1.1 and .net 2.0) that you can use with Attachmate Extra 6.7 or Extra! 9. Let me know if you're interested and I could send.

Tom