Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2003, 10:21 AM
Registered User
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run an exe

I am new to Windows programming and am trying to get my head around C# (like it so far).

I would some advice on how to do the following :-

I have .exe delivered to me from a third party that creates software key. It takes on argument (a filename) and encrypts it
(eg filecrypt.exe key.dat, this is how I run it from the command line).

I want to make a more user friendly form to create the file that is to be encrypted (I can do this), what I can't work out is how to run this exe from within my application.

I think I am part of the way there by using this code
using System.Diagnostics
Process p = new Process();
p.StartInfo = new ProcessStartInfo("notepad.exe");
p.StartInfo.UseShellExecute = true;
p.Start();

I can't though work out how to start the process with a file as an argument.

Any ideas ? Anyone done this before ?
 
Old August 6th, 2003, 10:53 AM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

You can use the following to specify the argument.

   p.StartInfo.Arguments = "MyFile.txt";

Check out this article for some examples, http://www.csharpfriends.com/Article...?articleID=122. For more details, refer to the .NET Framework SDK.

Good luck.


Best regards,

Jude.





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run an exe application from ASP vik_asp Classic ASP Components 5 March 8th, 2013 02:18 AM
run .exe in asp hostxxi Classic ASP Basics 0 June 18th, 2008 04:01 AM
How to run another .exe from my program shivendra C++ Programming 1 July 28th, 2006 04:56 AM
Run a .bat or .exe on server plong Classic ASP Basics 2 May 9th, 2006 06:06 AM
Regarding To run EXE from ASP vppatil_20 Classic ASP Components 1 September 9th, 2004 03:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.