473,651 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capture cmd line traffic for windows application

I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOut put, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.

Nov 17 '05 #1
7 2360
Thompson_38,
I think this is the exact answer to what you are trying to do.
http://radio.weblogs.com/0111551/sto...ItsOutput.html

--
in**@dowhileloo p.com
http://dowhileloop.com website development
http://publicjoe.dowhileloop.com -- C# Tutorials

"thompson_3 8" <th*********@ho tmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOut put, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.

Nov 17 '05 #2
Thompson_38,
I think this is the exact answer to what you are trying to do.
http://radio.weblogs.com/0111551/sto...ItsOutput.html

--
in**@dowhileloo p.com
http://dowhileloop.com website development
http://publicjoe.dowhileloop.com -- C# Tutorials

"thompson_3 8" <th*********@ho tmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOut put, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.

Nov 17 '05 #3

"thompson_3 8" <th*********@ho tmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOut put, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.


I'm not clear on what you mean by 'I don't want to change the console
application', where did you put the StreamWriter, StringWriter ... then?

Willy.
Nov 17 '05 #4

"thompson_3 8" <th*********@ho tmail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a COM object that wraps a console application. This console app
outputs strings, using tprintf statements, throughout execution. I
would like to capture that output from the console app and display it
in my C# Windows.Forms test application. I have tried StreamWriter,
StringWriter, OpenStandardOut put, but I only get empty strings
returned. I do not want to change the console application nor the COM
app. I am still investigating, and if I find the answer I will be sure
to post it. Thanks for your help in advance.


I'm not clear on what you mean by 'I don't want to change the console
application', where did you put the StreamWriter, StringWriter ... then?

Willy.
Nov 17 '05 #5

"Landi" <in**@dowhilelo op.com> wrote in message
news:eH******** *****@TK2MSFTNG P12.phx.gbl...
Thompson_38,
I think this is the exact answer to what you are trying to do.
http://radio.weblogs.com/0111551/sto...ItsOutput.html

--


The sample in the link only works if you start the console application from
another C# program, which is not OP's scenario.

Willy.
Nov 17 '05 #6

"Landi" <in**@dowhilelo op.com> wrote in message
news:eH******** *****@TK2MSFTNG P12.phx.gbl...
Thompson_38,
I think this is the exact answer to what you are trying to do.
http://radio.weblogs.com/0111551/sto...ItsOutput.html

--


The sample in the link only works if you start the console application from
another C# program, which is not OP's scenario.

Willy.
Nov 17 '05 #7
Thank you for the information, I had tried the
http://radio.weblogs.com/01115*51/st...Seco*ndConsole....
, but the exe is not being called directly. I am sorry for the lack of
information, this is a C# windows test application the instantiates the
COM object. The COM object is a wrapper for the C++ console
application. The StreamWriter, StringWriter are being used in the
Test applications, not in either the COM object nor the C++ console
application.

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5977
by: xo55ox | last post by:
I am very new with php. And I want to find out how do I capture user cookies information for traffic analysis on Windows machine and server cookies from Linux server. thanks.
3
13497
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a compatibe Bitmap or DC it comes back with an error as win32ui: CreateCompatibleDC failed
4
4778
by: Mariano Drago | last post by:
Hi there! Im been googling all the day, but i can't find a clue about how to do what i need... So, I need to write a win32 application that "trace" or "log" or "capture" all outgoing HTTP traffic to a certain domain, putting it into a variable and parse it for a certain string... simple as it sounds, im going nuts with this! It's look like i need Winpcap or something like that, but i have no idea how to "hook" to the network adapter...
5
2375
by: TerryWilson | last post by:
I am developing a web based service tool using asp.net that we will distribute with our product. This service tool will be used for remotely configuring the product, problem determination, etc. One thing that I would like to be able to do is display a screen capture of our product running. I have the code to get the screen capture of the desktop and I also know how to send the image back to the client to be displayed. The problem is that...
9
7854
by: Hugh Janus | last post by:
Hi all, Does anybody know if it is possible with VB.NET to capture and redirect traffic that flows through a particular port? i.e. the app either listens or watches port 1234 for outgoing traffic. It then captures or copies all the traffic and simalteanously send it out of port 4321. Another possible example: telnet sends info out on port 23. I want that information captured and sent out in real-time (or almost) of port 80. And...
1
2446
by: Rune Jacobsen | last post by:
Hi, I've been trying to figure this one out, but my experience just doesn't have what it takes... :| I am writing an application that reads an XML file and displays the contents in various ways to the end user. This works fine. My challenge lies in the fact that these XML files are generated by various (third party) applications. Which application generates them depends on the user, the country they are in, their personal preferences,...
4
13063
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
I know how to capture a keypress for a windows application, but how would I go about doing it for a windows service? Rather than having a form in focus all the time, I would prefer to have something running in the background. There are option such as having the form invisible (opacity set to zero) and settings it's location as -200, -200 so that it isn't on the screen, but this isn't the ideal solution.
2
4382
by: Derrick | last post by:
Can anyone suggest a tool (if one exists) to capture IIS traffic and be able to "replay" that traffic? We are in the process of moving from sql2k to sql2005. What I would like to do is take a snapshot of the sql2k db, start iis logging, and let the prod site run for a few hours capturing all that traffic, then take another snap of the sql2k db. Then, in a test environment, I'd like to take the initial db, load to 2005, and then run...
11
18750
by: gustavo.samour | last post by:
Hi, I am writing a very basic raw ethernet sniffer based on what I found in Andreas Schaufler's raw ethernet article: http://aschauf.landshut.org/fh/linux/udp_vs_raw/ch01s03.html I'm trying to print the output of each ethernet frame in both hexadecimal and character representations. I'm new at network programming in C. Here's a code snippet:
0
8349
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7296
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.