Re: newbie help with elearning sample console.writeline



On Jun 20, 5:54 pm, "mp" <nos...@xxxxxxxxxx> wrote:
I'm working on some elearning courses from MS
i'm such a beginner i don't even know how to test the sample codes
create a new windows app, new console app, new class library?
lessons never tell a beginner the basic stuff - they always assume more
knowlege than i have
:-)

in this example it writes to the console
but when i run it, the dos prompt window flashes open and closes too fast to
read.
how to keep it open or where else to see the results of console.writeline
i don't see it in immediate window nor in output window.
even if i start a dosprompt before running this code the lines don't print
to that console, the other one still flashes open and closes immediately

here's the entire sample from elearning
Dim sFrame As StackFrame = New StackFrame(0, True)

' Display the flne name in execution

Console.WriteLine(" File: {0}", sFrame.GetFileName)

it doesn't say how to test it, but I started a new project in vb dotnet 2008
express - new console app

in module1.vb i pasted the code inside sub main

Module Module1

Sub Main()

Dim sFrame As StackFrame = New StackFrame(0, True)

' Display the flne name in execution

Console.WriteLine(" File: {0}", sFrame.GetFileName)

End Sub

End Module

then i hit debug-startdebugging

and the console window flashes (but it's behind the vis studio window - i
can see a corner of it only)

what am i missing?

thanks

mark

Just put "Console.ReadLine" just before "End Sub" of main sub.

HTH,

Onur Güzel
.



Relevant Pages

  • Re: working set and console applications
    ... I created a windows application and then I created a child console process ... that I started from the parent process using CreateProcess. ... I minimize the child console window it also causes the working set of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Q: writing to STDOUT/STDERR from MFC application ?
    ... Sure, but they aren't window programs, they are console programs! ... console app, write a console app. ... Joseph M. Newcomer [MVP] ...
    (microsoft.public.vc.mfc)
  • Re: Console applications window size
    ... AllocConsole() or AttachConsole. ... You already have a console, ... SMALL_RECT srWindowRect; // hold the new window size ... >exe from a cmd prompt, the same cmd prompt gets bigger properly. ...
    (microsoft.public.vc.language)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ...     ByVal hWnd As IntPtr, ...     End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Prevent Domain Users From Browsing Around in Active Directory?
    ... View, Customize, uncheck everything except the top one that says Console ... But they will have the rt-click feature. ... Rt-click on that OU, new window from here. ...
    (microsoft.public.windows.server.active_directory)