|
-
Sep 25th, 2003, 01:20 PM
#1
Thread Starter
Hyperactive Member
End Console application
I'm writing a console Application in VB.NET. I give user a list of menus to choose from and the last one is Enter 'Q' to quit.
Please let me know what command will actually close the console window.
thnx
-
Sep 25th, 2003, 01:39 PM
#2
Sleep mode
-
Sep 25th, 2003, 01:48 PM
#3
Sleep mode
Or instruct the user to type : exit and hit enter . I believe it works .
-
Sep 25th, 2003, 02:54 PM
#4
Thread Starter
Hyperactive Member
Application.Exit() is not recognized and exit didn't work either!
-
Sep 25th, 2003, 02:56 PM
#5
Sleep mode
Did you import System.Windows.Forms.dll to get the first one working?
Did you try typing 'exit' and hitting enter in the console window?
-
Sep 25th, 2003, 03:07 PM
#6
Thread Starter
Hyperactive Member
Since it is a console appllcation i.e. a module then how can we write
import System.Windows.Forms.dll
Secondly I'm presenting menu with console.Writeline and get the user input with console.readling commands.
It does not exit with command exit and then enter.
thanks
-
Sep 25th, 2003, 03:12 PM
#7
Sleep mode
Add reference to that dll where you can find it in the .NET tab. Then type " Imports System.Windows.Forms" at the very top of the module .
-
Sep 26th, 2003, 07:00 AM
#8
Thread Starter
Hyperactive Member
I tried to add the reference, but got an error saying:
'A reference to System.Windows.Forms.dll could not be added.Converting the type Library to .Net assembly failed. Type Library System_Windows_Forms was exported from a CLR assembly and cannot be re-imported as CLR assembly.'
Please suggest some remedy.
-
Sep 26th, 2003, 10:43 AM
#9
Sleep mode
I tried to build the console solution and it successfully done with no errors . Are you running Standard VB.NET version ?
-
Sep 26th, 2003, 12:32 PM
#10
Thread Starter
Hyperactive Member
Actually I was trying to set reference from the com tab. Now I could set the reference, add the imports statement
Imports System.Windows.Forms
and the command Application.exit
But this doesn't exit the application. Rather 'End' command is working (although I never used it in VB6 since it leaves the references hanging in memory.)
-
Sep 26th, 2003, 12:36 PM
#11
Sleep mode
Originally posted by ssingh
Actually I was trying to set reference from the com tab. Now I could set the reference, add the imports statement
Imports System.Windows.Forms
and the command Application.exit
But this doesn't exit the application. Rather 'End' command is working (although I never used it in VB6 since it leaves the references hanging in memory.)
What reference are you talking about ? Maybe System.Windows.Forms.dll ?
-
Sep 26th, 2003, 02:02 PM
#12
Thread Starter
Hyperactive Member
Yes! as you suggested yesterday
-
Sep 26th, 2003, 02:37 PM
#13
Sleep mode
Just set any obj you want to destroy to Nothing as this :
-
Sep 11th, 2006, 03:16 PM
#14
New Member
Re: End Console application
Here is how you can end a console application.
using System.Threading;
Process.GetCurrentProcess().Kill(); // Kills this program...
-
Dec 16th, 2010, 02:49 AM
#15
New Member
Re: End Console application
See, this is why VB developers are looked down upon. Guys, this is not rocket science!
[VBCODE]Sub Main()
Return 'RETURNS from the main application method.
End Sub[/VBCODE]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|