Linked Questions

1 vote
2 answers
4k views

I need to get all ASP files in a folder, so I wrote a code like this: string[] files = Directory.GetFiles(@"C:\Folder", "*.asp", SearchOption.AllDirectories); However, it also returns files with ...
Rafael Araujo's user avatar
-1 votes
1 answer
131 views

Specifically, I have a list of files and an array of compressed file extensions - I am trying to get all the zip files in a folder for later processing. I reviewed a couple other StackOverflow answers ...
Zachary Johnson's user avatar
0 votes
0 answers
22 views

hello all I'm making a process that will import a list of all the files in a given folder for processing. hoever I only want the files to go through the process if they are a PDF so far for importing ...
Matt Bartlett's user avatar
428 votes
28 answers
545k views

I am trying to use the Directory.GetFiles() method to retrieve a list of files of multiple types, such as mp3's and jpg's. I have tried both of the following with no luck: Directory.GetFiles("C:\\...
Jason Z's user avatar
  • 13.5k
28 votes
1 answer
5k views

Sometimes I need a hardcoded lookup table for a single method. I can create such an array either locally in the method itself static inside the class Example for the first case: public int Convert(...
HugoRune's user avatar
  • 13.9k
6 votes
2 answers
16k views

I currently have a window-form that when a button is pressed, will merge 3 separate word docx's into one combined file. private void button1_Click(object sender, EventArgs e) { ...
cgraham720's user avatar
0 votes
3 answers
2k views

I found several questions on Stack Overflow about the Directory.GetFiles() but in all of the cases, they explain how to use it to find a specific extension or a set of files through multiple criteria. ...
javier_el_bene's user avatar
3 votes
2 answers
2k views

Using: Visual Studio 2017 (Language: C#) I have a similar function written below in PowerShell script, but I need the C# version of it to execute on the click of a button within Visual Studio: Add-...
Josh Pulda's user avatar
-3 votes
1 answer
905 views

I am new to C# and I'm really having a trouble on finding a way to convert files(doc, xlsx, jpg, png, etc.) to base64. So far, what I got is a way to retrieve the path using Directory.GetFiles().......
aznmik's user avatar
  • 45
0 votes
3 answers
728 views

I would like to run all the .exe files in a certain directory from my winform application. Is there a way not to hard code the file path of each exe and be not dependent on knowing beforehand how many ...
Mirco Giraudo's user avatar
0 votes
2 answers
425 views

I have a foreach statement that is part this function: try { string pathToFiles = sourceTB.Text; DirectoryInfo dirInfo = new DirectoryInfo(pathToFiles); int i = 0; foreach (var files in ...
user avatar
0 votes
0 answers
453 views

I am trying to search for text in each PDF inside of a directory using itext7. I can figure out how to search just one PDF. I managed to search one pdf using the below code, how can I make this work ...
Billy Sharpe's user avatar
0 votes
2 answers
155 views

It's not similar to anything posted on the internet, I am the author of this project that was created some 8 years ago. This project is for my thesis today for my Masteral Degree. I need to improve ...
Aldrich Genova Uy's user avatar
0 votes
2 answers
97 views

I currently learning about ASP.NET MVC 4. I want to display .cs and .cpp files located in a directory on the web page. But somehow I get exception for multiple file type display. Below line of code ...
Unbreakable's user avatar
  • 8,172