472,805 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

screen scraping dos application

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?

Dec 23 '09 #1
1 3443
270 100+
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();
  19.                 // Get the output into a string
  20.                 string result = proc.StandardOutput.ReadToEnd();
  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.         }
Dec 23 '09 #2

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

Similar topics

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...
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...
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...
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...
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...
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...
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...
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...
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.
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.