CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    3

    Finding name of a method

    Is there a way of finding the name of the method presently executing in order to include the method name in a debug printout ?

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    when you are in debug mode then put a break point where u are and go to debug of vs.net then under window you can see call stack or you could press
    CTRL+ALT+C and print the stack trace.

    or do you want the text file programatically. in that case your question seems to be too brief.

    Paresh

  3. #3
    Join Date
    Jan 2003
    Posts
    3
    I want to include trace/debug statements in deployed code
    where the name of the method issuing the trace statements
    is included in the statement

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    look in TRACE

    public int Main(string[] args)
    {
    Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
    Trace.AutoFlush = true;
    Trace.Indent();
    Trace.WriteLine("Entering Main");
    Console.WriteLine("Hello World.");
    Trace.WriteLine("Exiting Main");
    Trace.Unindent();
    return 0;
    }

    for more info or problem you could find
    here

    PareshGotDotNet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured