473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

screen scraping dos application

1
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 3491
NitinSawant
270 100+
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
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...
2
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...
3
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...
4
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...
7
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...
0
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...
7
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...
4
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...
3
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...

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.