Re: Determine whether App is running is Visual Studio

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Éric Moreau (eric.moreau_.N.O.S.P.A.M.__at_videotron.ca)
Date: 04/19/04


Date: Mon, 19 Apr 2004 06:00:41 -0400

You can use this:

Public Shared Function IsInIDE() As Boolean

If System.Diagnostics.Debugger.IsAttached Then

'The application is currently running from within the IDE.

Return True

Else

'The application is currently running as a compiled application.

Return False

End If

End Function

-- 
HTH
Éric Moreau, MCSD
Conseiller Principal / Senior Consultant
Concept S2i inc.(www.s2i.com)
"cody" <no_spam_deutronium@gmx.net> wrote in message
news:uGXuH$eJEHA.952@TK2MSFTNGP12.phx.gbl...
> Is there a way to do:
>
> #if APP_IS_RUN_IN_VS
> path = ".\..\..\..\myfile.rpt";
> #else
> path = "myfile.rpt";
> #endif
>
> I don't want to put the files into debug/bin dir since they woulbe be
> deleted on rebuilt then.
>
> --
> cody
>
> Freeware Tools, Games and Humour
> http://www.deutronium.de.vu  || http://www.deutronium.tk
>
>


Relevant Pages

  • Re: Determine whether App is running is Visual Studio
    ... > Public Shared Function IsInIDE() As Boolean ... > 'The application is currently running from within the IDE. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: zebra Printer
    ... ByVal pd As Integer) As Boolean ... Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) As ... bSuccess = myPrinterThreadObj.retVal ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to terminate a running program from another NETCF app
    ... second app that fires the event in the first. ... Public Shared Function CreateEvent(ByVal lpEventAttributes As IntPtr, ... ByVal bManualReset As Boolean, ByVal bInitialState As Boolean, ByVal lpName ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: USB Zebra Printer Communication
    ... Public Shared Function OpenPrinter(ByVal src As String, ... ByVal pd As Long) As Boolean ... Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: USB Zebra Printer Communication
    ... Public Shared Function OpenPrinter(ByVal src As String, ... ByVal pd As Long) As Boolean ... Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) ...
    (microsoft.public.dotnet.languages.vb)