Hi Nikolay
You could create a StackTrace for this:
Dim m As New System.Diagnostics.StackTrace
MessageBox.Show("trace " & m.ToString())
Note that this gives the complete call stack...
And one more thing - to get an ID, you could try something like this:
Dim sf As New System.Diagnostics.StackFrame
Dim s As String = Me.GetType.Name & sf.GetMethod().Name
MessageBox.Show("id: " & s.GetHashCode())
I'm not sure that this would be a good idea though...it's not exactly the
most performant way of getting an ID value.
HTH anyway
Nigel Armstrong
"Nikolay Petrov" wrote:
How about the name of calling class?
"Nigel Armstrong" <Ni************@discussions.microsoft.com> wrote in
message news:DC**********************************@microsof t.com... Hi Nikolay
Try this for starters:
Dim tString As String = Me.GetType().Name ' Class name
Dim s As New System.Diagnostics.StackFrame(True) ' Method name
MessageBox.Show(tString & " " & s.GetMethod().Name)
HTH
Nigel Armstrong
"Nikolay Petrov" wrote:
Hi guys,
I am implementing a loging system in my app and I need a way to get name
of
current class and name of the current method, so I can pass them to my
loging system.
Also I want to asign an ID to each method, so I can pass it to the loging
system.
But it is not easy to remeber which is the last ID I've used, so I can
assign a new ID to newly created methods. Any ideas how to accomplish
this.
TIA