Get the name of the file...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a class. How could i obtain the name of the file of this class (for
example, if my class name is test, the name of the file is test.cs)
 
Josema said:
Hi,

I have a class. How could i obtain the name of the file of this class (for
example, if my class name is test, the name of the file is test.cs)

What is your question? You seem to have given
the answer yourself.
 
If you have a class name, use

typeof(Test).Assembly.Location

If you have a variable, use

myTest.GetType().Assembly.Location
 
Back
Top