|
/* This file contains utility functions for use in the AudioMerger project.
*
* Date Author Description
* 2009-03-24 erico Created
*/
using System;
using System.IO;
namespace AudioMerger
{
class UtilityFunctions
{
/// <summary>
/// Removes a directory, including all the files in it.
/// </summary>
/// <param name="pPath">The directory to remove</param>
/// <returns>A blank string upon success, or a warning upon error. If the directory does not exist, that is not an error.</returns>
public static String DeleteDir(String pPath)
{
String retval = "";
if (Directory.Exists(pPath))
{
try
{
// Delete all the files
String[] filenames = Directory.GetFiles(pPath);
foreach (String filename in filenames)
File.Delete(filename);
// Delete the directory
Directory.Delete(pPath, true);
}
catch (System.Exception exc)
{
retval = exc.Message;
}
}
return retval;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I was born and raised (and currently still reside in) northwest Oregon, USA. I started using computers at a very young age, maybe 4 or 5 years old, using my dad's computers. I got my own computer when I was 12 (1992). Later, I realized that I really enjoy programming, and in college, I decided to get a degree in software engineering. In 2005, I earned my bachelor's degree in software engineering from Oregon Institute of Technology.
I have been working as a software engineer since October 2003. So far, I've had experience with C++, PHP, JavaScript, Perl, Bash shell scripting, C#, and HTML. I have developed GUIs with MFC, wxWidgets, and WinForms. I also have experience with open-source technologies such as Linux, Apache, MySQL, and PostgreSQL. My favorite Linux text editor is Vim.
In my personal time I enjoy tinkering with computers (building PCs, gaming, occasionally working on personal programming projects), playing music (I enjoy playing guitar and synthesizer/piano), and spending time with family & friends. I also enjoy reading the occasional book (pretty much anything with a good story, but usually sci-fi, drama, programming books, advice books, and scientific non-fiction, such as books written by physicist
Michio Kaku). Currently, my favorite TV show is The Office; I also like watching the news when I can. I also enjoy the occasional movie (sci-fi, comedy, action, drama; pretty much anything with a good story).