473,569 Members | 2,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

screen scraping dos application

1 New Member
Hi All,

Can somebody maybe please help me?

- how do i screen scrape data from a dos application / window to .net application by using c#?
- how do i screen scrape data from a dos application / window to sql database?
- how do i screen scrape data from a dos application / window to sql database and insert other data back to the dos application / window?

Thanks
Dec 23 '09 #1
1 3510
NitinSawant
270 Contributor
Dear,
Hear's function for doing the task,

executes the command using cmd and returns the output as text

Expand|Select|Wrap|Line Numbers
  1. public String ExecuteCommandSync(object command)
  2.         {
  3.             try
  4.             {
  5.                 // create the ProcessStartInfo using "cmd" as the program to be run, and "/c " as the parameters.
  6.                 // Incidentally, /c tells cmd that we want it to execute the command that follows, and then exit.
  7.                 System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
  8.                 // The following commands are needed to redirect the standard output. 
  9.                 //This means that it will be redirected to the Process.StandardOutput StreamReader.
  10.                 procStartInfo.RedirectStandardOutput = true;
  11.                 procStartInfo.UseShellExecute = false;
  12.                 // Do not create the black window.
  13.                 procStartInfo.CreateNoWindow = true;
  14.                 // Now we create a process, assign its ProcessStartInfo and start it
  15.                 System.Diagnostics.Process proc = new System.Diagnostics.Process();
  16.                 proc.StartInfo = procStartInfo;
  17.                 proc.Start();
  18.  
  19.                 // Get the output into a string
  20.                 string result = proc.StandardOutput.ReadToEnd();
  21.  
  22.                 // Display the command output.
  23.                 return result;
  24.             }
  25.             catch(Exception ex)
  26.             {
  27.                 // Log the exception
  28.                 //return "";
  29.                 throw ex;
  30.             }
  31.         }
  32.  
Dec 23 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
5730
by: Roland Hall | last post by:
Am I correct in assuming screen scraping is just the response text sent to the browser? If so, would that mean that this could not be screen scraped? function moi() { var tag = '<a href='; var tagType1 = '"mail'+'to:', tagType2 = '">', tagType3 = '<\/a>'; var user1 = 'web', user2 = 'master', user3 = '@'; var dom1 = 'danger', dom2 = 'ous',...
2
8287
by: Me | last post by:
I am dealing with a poorly written windows application that does not contain an API. I would like to use C# to run a predetermied set of steps in the application and scrape the resulting data from the screen and write it to a SQL database. That said, I have no idea how to go about doing so in C#. Any ideas, samples or links would be...
3
2350
by: Jim Giblin | last post by:
I need to scrape specific information from another website, specifically the prices of precious metals from several different vendors. While I will credit the vendors as the data source, I do not want to use the format of their pages, and want the inforamtion consolidated to a single page of my design. I did something like this for a...
4
3448
by: rachel | last post by:
Hello, I am currently contracted out by a real estate agent. He has a page that he has created himself that has a list of homes.. their images and data in html format. He wants me to take this page and reformat it so that it looks different. Do I use screen scraping to do this? Could someone please point me to a good screen scraping
7
2158
by: Swanand Mokashi | last post by:
Hi all -- I would like to create an application(call it Application "A") that I would like to mimic exactly as a form on a foreign system (Application "F"). Application "F" is on the web (so basically I can not control it). I will have a form exactly on Application "A" as that of Application "F". Application "A" will submit to the url of...
0
1322
by: Tarun | last post by:
I Have tried to fetch some XML data through screen scraping by the following code: System.Net.ServicePointManager.CertificatePolicy = New MyCertificatePolicy dim path as String="" Try Dim req As HttpWebRequest = CType(WebRequest.Create(path), HttpWebRequest) Dim res As HttpWebResponse = CType(req.GetResponse, HttpWebResponse)
7
2601
by: ionphoenix | last post by:
i am currently working in a hospital which uses a pretty own system in basic, however we are using an emulator to access this application from unix,since its program run as a database program inside unix..although it is in unix solaris access to its actual files is impossible.. if somecode can point me, give me a source code for screen scraping...
4
3311
by: different.engine | last post by:
Folks: I am screen scraping a large volume of data from Yahoo Finance each evening, and parsing with Beautiful Soup. I was wondering if anyone could give me some pointers on how to make it less obvious to Yahoo that this is what I am doing, as I fear that they probably monitor for this type of activity, and will soon ban my IP.
3
5157
by: WFDGW2 | last post by:
I want to write or obtain C++ code that will scrape text from a dialog box within a poker client, and then record that text somewhere else. What do I do? Thanks.
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.