C# get all files in directory
C#
string[] allfiles = Directory.GetFiles("path/to/dir", "*.*", SearchOption.AllDirectories);//path is the path of the directory to get files from
//searchPattern is to get specific files. If you want only exe files you enter *.exe
private static IEnumerable<string> GetAllFiles(string path, string searchPattern)
{
return Directory.EnumerateFiles(path, searchPattern).Union(
Directory.EnumerateDirectories(path).SelectMany(d =>
{
try
{
return GetAllFiles(d, searchPattern);
} catch(Exception e)
{
return Enumerable.Empty<string>();
}
}));
}
Also in C#:
- Title
- generics in c#
- Category
- C#
- Title
- unity gizmo draw line
- Category
- C#
- Title
- decimal to string whole number c#
- Category
- C#
- Title
- unity cycle children
- Category
- C#
- Title
- unity how to see what scen you are in
- Category
- C#
- Title
- c# creating a data recovery software
- Category
- C#
- Title
- c# get gridview DataKeyNames
- Category
- C#
- Title
- how to deactivate objects through scripts in unity
- Category
- C#
- Title
- How to set an expiry date on a program
- Category
- C#
- Title
- image filter
- Category
- C#
- Title
- run async methods within a sync process
- Category
- C#
- Title
- c# System.Resources.MissingManifestResourceException error
- Category
- C#
- Title
- scaffold-dbcontext sql server
- Category
- C#
- Title
- how to add movement in unity
- Category
- C#
- Title
- input get button uibutton
- Category
- C#
- Title
- c# list to string
- Category
- C#
- Title
- unity t-flip flop
- Category
- C#
- Title
- open file in explorer c#
- Category
- C#
- Title
- c# loop
- Category
- C#
- Title
- unity ui not seen
- Category
- C#
- Title
- trello
- Category
- C#
- Title
- create asp.net which send email and sms using own api
- Category
- C#
- Title
- weakreference tryget c#
- Category
- C#
- Title
- c# format string to date yyyymmdd
- Category
- C#
- Title
- prefab gets character transform
- Category
- C#
- Title
- c# public static string
- Category
- C#
- Title
- zoom gedit
- Category
- C#
- Title
- asp.net textarea disable resize
- Category
- C#
- Title
- how to disable a gameObject unity c#
- Category
- C#
- Title
- set int to null c#
- Category
- C#
- Title
- c# checksum
- Category
- C#
- Title
- built in methods to order a list c#
- Category
- C#
- Title
- csharp datetime string format
- Category
- C#
- Title
- how to get value from object in c#
- Category
- C#
- Title
- c sharp split by newline
- Category
- C#
- Title
- c# get hwid
- Category
- C#
- Title
- C# downloadstirng download old
- Category
- C#
- Title
- hwo to make an array in C#
- Category
- C#
- Title
- file picker uwp c#
- Category
- C#
- Title
- get enum by index c#
- Category
- C#
- Title
- c# print
- Category
- C#
- Title
- isdaylightsavingtime in c#
- Category
- C#
- Title
- optional parameter get request c#
- Category
- C#
- Title
- how to make rb.addforce 2d
- Category
- C#
- Title
- matplotlib measure the width of text
- Category
- C#
- Title
- check if string is email c#
- Category
- C#
- Title
- convert generic to type c#
- Category
- C#
- Title
- C# array index tostring
- Category
- C#
- Title
- unity persistent data
- Category
- C#
- Title
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- Category
- C#
- Title
- wpf textblock line break code behind
- Category
- C#
- Title
- c# stop loop
- Category
- C#
- Title
- change Backcolor c#
- Category
- C#
- Title
- unity reset scene
- Category
- C#
- Title
- c# catch two exceptions in one block
- Category
- C#
- Title
- unity pro version free download
- Category
- C#
- Title
- asp.net core 3.1: cast jObject to dictionary<string,string>
- Category
- C#
- Title
- add spaces between words unity
- Category
- C#
- Title
- edit form item from class C#
- Category
- C#
- Title
- c sharp index of substring
- Category
- C#
- Title
- wpf binding ancestor codebehind
- Category
- C#
- Title
- unity round
- Category
- C#
- Title
- unity set list of strings
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- c# set textbox text
- Category
- C#
- Title
- how to raycast unit
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- Int64
- Category
- C#
- Title
- c# add to array
- Category
- C#
- Title
- Unity C# add slider into editor
- Category
- C#
- Title
- How to search for a string from readline in c#
- Category
- C#
- Title
- c# arraylist
- Category
- C#
- Title
- Unity3d GPS code
- Category
- C#
- Title
- c# remove last value from list
- Category
- C#
- Title
- c# change material in code
- Category
- C#
- Title
- copy a list C#
- Category
- C#
- Title
- comments unity c#
- Category
- C#
- Title
- Replaced OS is obselete
- Category
- C#
- Title
- set decimal point c#
- Category
- C#
- Title
- Check object is in layermask unity
- Category
- C#
- Title
- enums as numbers c#
- Category
- C#
- Title
- if and c#
- Category
- C#
- Title
- how to route back to url using Request.Headers["Referer"].ToString() in asp.net core
- Category
- C#
- Title
- c# counting lines
- Category
- C#
- Title
- can send but cannot receive email dreamhost email
- Category
- C#
- Title
- panel drag all form c#
- Category
- C#
- Title
- create object in c#
- Category
- C#
- Title
- git checkout reset hard
- Category
- C#
- Title
- c# find duplicates in list
- Category
- C#
- Title
- c# get executable path
- Category
- C#
- Title
- c# class declaration
- Category
- C#
- Title
- c# string to byte array
- Category
- C#
- Title
- C# .NET Core linq Distinct
- Category
- C#
- Title
- unity check when clicked on object
- Category
- C#
- Title
- c# verify in class exist in list
- Category
- C#
- Title
- check for collision unity c#
- Category
- C#
- Title
- how to wait in c#
- Category
- C#
- Title
- c# mathf.ceiling
- Category
- C#
- Title
- Generate Genealogy view in mvc C# using Google Organizational Chart
- Category
- C#
- Title
- vector between two points unity
- Category
- C#