Re: Stand alone Executable return argument

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bob Grommes (bob_at_bobgrommes.com)
Date: 10/28/04


Date: Thu, 28 Oct 2004 06:29:31 -0700

Just change public static void main to public static int main, and return
whever error code you want to return to the process. Then any other process
running your EXE can check the return code.

--Bob

"Sunny" <Sunny@discussions.microsoft.com> wrote in message
news:61F243CF-E0DD-4DE5-BAB3-E8DC70D3A03F@microsoft.com...
> Hi,
> I have a very serious issue at hand. I have created a small C# Console App
> (Csd.exe) that collects a list of files as its argument and generates
> their
> Md5 sets.
> This application is used by other applications in my dept, which simply
> call
> this Csd.exe app and passing a list of files.
> I want to ask how can I return a value from this Csd.exe application as an
> indicator or a signal to the calling app that Csd.exe has finished
> working.
> The problem is that the main component of my Csd.exe is a
>
> public static void main(string[] args)
> {
> //All the work
> //And that is it (done)!
> //Here i want to enter a return int or a bool (true) so that the caller
> can know
> //that i am finished processing....
> }
>
> The Static void main does not let me return anything. How can i do that.
>
> Please HELP!
>
> Thanks and Regards
> Sunny
>



Relevant Pages

  • Re: ExitTime not in Process ExitHandler
    ... pressing Ctrl-C in the second app). ... Code to reproduce the issue (maybe I should raise it as a bug - I don't know ... static void Main ... MessageQueue myQ = sender as MessageQueue; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Formless apps possible?
    ... I'm writing an app that shows up as an icon on the Today screen (ie no form ... >> public class MyApp ... >> static void Main ... >>> The SDF has an ApplicationEx.Run with a no parameter overload. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: how to resolve System.InvalidOperationException
    ... delegate for passing mainform's instance. ... background thread, written for .NET 1.1. ... The invocation of the method which calls methods on the UI (i.e. the App ... static void App_Shown ...
    (microsoft.public.dotnet.framework.clr)
  • Re: File.Exists strangeness, has become Solution strangeness...
    ... "Jake" wrote: ... this is a console app... ... > functionality runs in the static void Main method. ... I'll settle for a hard fix, ...
    (microsoft.public.dotnet.framework.compactframework)