Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Return Name of a Function

Return Name of a Function

Scheduled Pinned Locked Moved Visual Basic
csharpasp-nethelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jcrussell
    wrote on last edited by
    #1

    I'm trying to log errors to a log file and I want to write the name of the function/sub where the error message occurs to the text file. eg private sub DoOperation() . . . if errorOccured then LogError(subName) end if end sub is this possible? I'm using VB.NET writing an ASP.NET Application with .NET 2.0 (VS2005)

    Jason

    J 1 Reply Last reply
    0
    • J jcrussell

      I'm trying to log errors to a log file and I want to write the name of the function/sub where the error message occurs to the text file. eg private sub DoOperation() . . . if errorOccured then LogError(subName) end if end sub is this possible? I'm using VB.NET writing an ASP.NET Application with .NET 2.0 (VS2005)

      Jason

      J Offline
      J Offline
      jcrussell
      wrote on last edited by
      #2

      Just worked it out: System.Reflection.MethodBase.GetCurrentMethod.Name

      Jason

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups