Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to get the directory of the project in c#

using System;
using System.IO;

// This will get the current WORKING directory (i.e. inDebug)
string workingDirectory = Environment.CurrentDirectory;
// or: Directory.GetCurrentDirectory() gives the same result

// This will get the current PROJECT bin directory (ie ../bin/)
string projectDirectory = Directory.GetParent(workingDirectory).Parent.FullName;

// This will get the current PROJECT directory
string projectDirectory = Directory.GetParent(workingDirectory).Parent.Parent.FullName;
Comment

C# get project directory

string wanted_path = Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory()));
Comment

get working directory c#

var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"");
if (index > 0)
	WorkingDirectory = DDIR.Substring(0, index) + @"";
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to flip character in unity 2d 
Csharp :: vscode c# how to change to externial terminal 
Csharp :: smooth rotation unity 
Csharp :: c# create new thread 
Csharp :: core Request.CreateResponse 
Csharp :: setup authorize in swagger .net core 
Csharp :: init dictionary c# 
Csharp :: Csharp convert string to double 
Csharp :: c# remove all null from list 
Csharp :: C#: convert array of integers to comma separated string 
Csharp :: c# length 2d array 
Csharp :: C# cycle through directory 
Csharp :: change textbox location C# 
Csharp :: how to play video in ui unity 
Csharp :: c# get wifi ip address 
Csharp :: c# get object property value by name 
Csharp :: unity know when gameobject presed 
Csharp :: c# require administrator permissions 
Csharp :: c# get current milliseconds 
Csharp :: C# reflection invoke static generic method 
Csharp :: unity text display int 
Csharp :: close window from page xaml 
Csharp :: set active for a seconds 
Csharp :: how to make a quit button in unity 
Csharp :: c# check valid datetime 
Csharp :: typeahead causing validation error asp 
Csharp :: c# cmd 
Csharp :: c# close 1 form open another form 
Csharp :: C++ in C# 
Csharp :: how to configure session timeout in asp.net core 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =