Answers for "C# get project directory"

C#
2

get working directory c#

var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"\");
if (index > 0)
	WorkingDirectory = DDIR.Substring(0, index) + @"\";
Posted by: Guest on September-15-2020
0

c# project path

string startupPath = System.IO.Directory.GetCurrentDirectory();

string startupPath = Environment.CurrentDirectory;
Posted by: Guest on October-11-2020
0

get project name in C#

[MethodImpl(MethodImplOptions.NoInlining)]
public static string JndGetEmailTextForDebuggingExceptionError(this Exception Ex)
{
    StackFrame sf = Ex.JndGetStackFrame();

    string OutputHTML =         "<i><b><u>For Developer Use Only: </u></b></i>"                    + "<br>" + 
                                                                                                     "<br>" +
                                "Project Name:   "  + Assembly.GetCallingAssembly().GetName().Name + "<br>" +
                                "File Name:      "  + sf.GetFileName()                             + "<br>" +
                                "Class Name:     "  + sf.GetMethod().DeclaringType                 + "<br>" +
                                "Method Name:    "  + sf.GetMethod()                               + "<br>" +
                                "Line Number:    "  + sf.GetFileLineNumber()                       + "<br>" +
                                "Line Column:    "  + sf.GetFileColumnNumber()                     + "<br>" +
                                "Error Message:  "  + Ex.Message                                   + "<br>" +
                                "Inner Message : "  + Ex.InnerException.Message                    + "<br>";

    return OutputHTML;
}
Posted by: Guest on July-16-2021
0

C# get project directory

string wanted_path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));
Posted by: Guest on October-15-2021

Code answers related to "C# get project directory"

C# Answers by Framework

Browse Popular Code Answers by Language