473,387 Members | 1,899 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,387 software developers and data experts.

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
Nov 16 '05 #1
6 8604
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

Nov 16 '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

Nov 16 '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

Nov 16 '05 #4
Hi,

simplest thing would be using the below line of code

System.Diagnostics.Process.Start(@"yourpath to your
application\WindApp.exe");

HTH
irfan
Nov 16 '05 #5
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

Nov 16 '05 #6
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.


Nov 16 '05 #7

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

Similar topics

4
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...
5
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? ...
7
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
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...
5
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
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
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
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...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
6
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.