Click here to Skip to main content
12,405,868 members (43,671 online)
   

C#

 
QuestionFull path name of .cs file Pin
TheGermoz20-Nov-12 10:35
memberTheGermoz20-Nov-12 10:35 
Is there a way to return the full path name of the file containing the code?
suppose I have the following class in the file c:\myproject\CA.cs
// CA.cs
public static class A
{
public static void Show()
{
string myFile = .... // here should read where the code is i.e c:\myproject\CA.cs
Console.WriteLine(myFile);
}
}


modified 20-Nov-12 17:08pm.

AnswerRe: Full path name of .cs file Pin
Garth J Lancaster20-Nov-12 11:42
memberGarth J Lancaster20-Nov-12 11:42 
AnswerRe: Full path name of .cs file Pin
jschell20-Nov-12 12:24
memberjschell20-Nov-12 12:24 
AnswerRe: Full path name of .cs file Pin
PIEBALDconsult20-Nov-12 12:56
memberPIEBALDconsult20-Nov-12 12:56 
GeneralRe: Full path name of .cs file Pin
TheGermoz20-Nov-12 17:28
memberTheGermoz20-Nov-12 17:28 
GeneralRe: Full path name of .cs file Pin
PIEBALDconsult20-Nov-12 18:06
memberPIEBALDconsult20-Nov-12 18:06 
GeneralRe: Full path name of .cs file Pin
TheGermoz20-Nov-12 18:12
memberTheGermoz20-Nov-12 18:12 
GeneralRe: Full path name of .cs file Pin
Richard MacCutchan20-Nov-12 21:34
mvpRichard MacCutchan20-Nov-12 21:34 
GeneralRe: Full path name of .cs file Pin
Pete O'Hanlon20-Nov-12 22:10
protectorPete O'Hanlon20-Nov-12 22:10 
GeneralRe: Full path name of .cs file Pin
PIEBALDconsult21-Nov-12 3:13
memberPIEBALDconsult21-Nov-12 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 29 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid