473,504 Members | 13,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoking a command line .exe program

Hi,

I have a simple .exe application that I need to invoke from my C#
application. I need to send it two strings and then get the result back.

Can anyone advise me on how this is done?

Also, I'm currently using a windows forms application but I would like to
use an ASP.net appliocation to invoke the .exe file in the future. Is this
possible and will it cause any complications?

Thanks everyone

Simon
Jul 21 '05 #1
5 2587
Hi,

Did you try System.Diagnostics.Process.Start()?

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:#I**************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a simple .exe application that I need to invoke from my C#
application. I need to send it two strings and then get the result back.

Can anyone advise me on how this is done?

Also, I'm currently using a windows forms application but I would like to
use an ASP.net appliocation to invoke the .exe file in the future. Is this
possible and will it cause any complications?

Thanks everyone

Simon

Jul 21 '05 #2
Answer to the first part of the question: take a look at
System.Diagnostics.Process.

Christian
"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a simple .exe application that I need to invoke from my C#
application. I need to send it two strings and then get the result back.

Can anyone advise me on how this is done?

Also, I'm currently using a windows forms application but I would like to
use an ASP.net appliocation to invoke the .exe file in the future. Is this
possible and will it cause any complications?

Thanks everyone

Simon

Jul 21 '05 #3
Simon,

ASP.NET application can invoke an ece in the same way as Windows form one.
The only difference is that you will need to grant "run executable" rights
to account aspnet runs under.

Eliyahu

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a simple .exe application that I need to invoke from my C#
application. I need to send it two strings and then get the result back.

Can anyone advise me on how this is done?

Also, I'm currently using a windows forms application but I would like to
use an ASP.net appliocation to invoke the .exe file in the future. Is this
possible and will it cause any complications?

Thanks everyone

Simon

Jul 21 '05 #4
The other responders gave you the answer.

I have a question: did you write the command line app? If so, can it be
rewritten in .NET?
That would give you some better answers when it comes to using resources,
especially if you plan to run this in a server.

Running it from a web page will work, but it won't be terribly scalable.

--- Nick

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a simple .exe application that I need to invoke from my C#
application. I need to send it two strings and then get the result back.

Can anyone advise me on how this is done?

Also, I'm currently using a windows forms application but I would like to
use an ASP.net appliocation to invoke the .exe file in the future. Is this
possible and will it cause any complications?

Thanks everyone

Simon

Jul 21 '05 #5
Giving the ASPNET account "run executable" rights is a terrible security
hole. I would strongly suggest that you look for another solution to your
problem, perhaps rewriting the executable as a windows service (or wrapping
it on one) and having the ASP application set certain conditions (such as a
flag in the DB) that cause the code currently in the executable to run.

Eric
ASP.NET application can invoke an ece in the same way as Windows form one.
The only difference is that you will need to grant "run executable" rights
to account aspnet runs under.


Jul 21 '05 #6

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

Similar topics

4
10305
by: Tian | last post by:
In Windows, I have been simply using os.system() to run command line program in python. but there will be a black console window. How can I run the program without invoking that window? i guess...
7
4715
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
7
2005
by: ~neil~ | last post by:
hello I'm fairly new to the language, and my problem is I'm trying to write a program to run a command from the DOS prompt "C:>". I don't know all the functions in "C", however there are a few...
6
8609
by: Simon Harvey | last post by:
Hi, I have a simple .exe application that I need to invoke from my C# application. I need to send it two strings and then get the result back. Can anyone advise me on how this is done? ...
5
1273
by: Rob Cowie | last post by:
Hi all, An idea popped into my head recently for an app that would track how much time a user spends in a particular piece of software (or at least, for how long an application is open). I'm...
14
3515
by: Gio Galma | last post by:
how I can invoke the db2diag utility in a Windows environment? in my D:\Program Files\IBM\SQLLIB\BIN directory I can see only db2diag.dll, and it seems there isn't the command line version; which...
1
1806
by: Luc The Perverse | last post by:
Hello! You may remember me as the guy who's trying to learn C# and using that old version 2003 of visual studio. (Although free version of command line .NET compiler is available, so if some new...
1
1651
by: tanzeem | last post by:
i have a perl cgi script named extracter.cgi which calls a perl script(remote.pl) that resides in the same directory(/var/www/cgi-bin).The program works when run in command line . But when...
6
1870
by: John O'Flaherty | last post by:
Hello. I have an ms acess database that I use to track my mp3 files. I have included code that lets me select and play files by invoking an mp3 player (Winamp). This is done by using visual basic...
0
7213
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
7298
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,...
1
7017
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...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
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,...
1
5026
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...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
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.