in the constructor:

class x {

    static string currentFile = new System.Diagnostics.StackTrace(true
).GetFrame(0).GetFileName();

}


On 12 September 2011 21:34, Michael Minutillo
<[email protected]>wrote:

> Hey all,
>
> Hopefully a simple one (or impossible). Is there a way to embed the current
> filename into a class using the preprocessor? i.e. In Ruby you can use the
> predefined variable __FILE__ (or something I don't remember the specifics).
>
> I want this info for reasons that are complex and boring and I really don't
> want to have to dig into pdb files or write my own precompilation step to
> achieve what I need.
>
> Michael M. Minutillo
> Indiscriminate Information Sponge
> http://codermike.com
>



-- 
regards,
Preet, Overlooking the Ocean, Auckland

Reply via email to