Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to get the path of the current directory in c#

string exePath = AppDomain.CurrentDomain.BaseDirectory;
// returns the directory where the .exe is located
Comment

get directory name of path c#

string filename = @"C:/folder1/folder2/file.txt";
string FolderName = new DirectoryInfo(System.IO.Path.GetDirectoryName(filename)).Name;
Comment

get documents path c#

String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Comment

c# get folder path from file path

Path.GetDirectoryName(filename);
Comment

c# how to get a file path from user

OpenFileDialog choofdlog = new OpenFileDialog();
choofdlog.Filter = "All Files (*.*)|*.*";
choofdlog.FilterIndex = 1;
choofdlog.Multiselect = true;

if (choofdlog.ShowDialog() == DialogResult.OK)    
{     
    string sFileName = choofdlog.FileName; 
    string[] arrAllFiles = choofdlog.FileNames; //used when Multiselect = true           
}
Comment

c# how to get a file path from user

FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.Description = "Custom Description"; 

if (fbd.ShowDialog() == DialogResult.OK)
{
    string sSelectedPath = fbd.SelectedPath;
}
Comment

c# get folder of full ilepath

string fileName = @"test.txt";
    string currentDirectory = Directory.GetCurrentDirectory();
    string[] fullFilePath = Directory.GetFiles(currentDirectory, filename, SearchOption.AllDirectories);
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# last char in string 
Csharp :: particle system start color 
Csharp :: c# OrderBy desc 
Csharp :: unity instantiate prefab 
Csharp :: split string on last element 
Csharp :: c# concatenation 
Csharp :: unity sound 
Csharp :: c# space as string 
Csharp :: event trigger by code unity 
Csharp :: c# remove first 5 characters from string 
Csharp :: Squares of a Sorted Array 
Csharp :: write last element of dictionary c# 
Csharp :: how to save a dictionary as a csv file in c# 
Csharp :: destroy the game object if the animator has finished its animation 
Csharp :: asp.net core mvc jsonresult example 
Csharp :: c# linq distinct group by nested list 
Csharp :: C# Http.HttpRequestMessage 
Csharp :: integer required asp.net core 
Csharp :: c# bubble sort 
Csharp :: remove duplicate characters in a string c# 
Csharp :: Long, Max and Min value 
Csharp :: c# remove all punctuation from string 
Csharp :: wpf get function name 
Csharp :: how to get row index of selected row in gridview asp.net webforms 
Csharp :: what is a model in c# 
Csharp :: Get the Photon Player GameObject 
Csharp :: c# allowedusernamecharacters 
Csharp :: how to evaluate code in c# 
Csharp :: split lines c# 
Csharp :: selenium scroll to element c# 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =