.

create a folder if not exists

 

string filename = @"c:\here\there\where\myname.txt";

    string dir = Path.GetDirectoryName(filename);
    if (!System.IO.Directory.Exists(dir))
        System.IO.Directory.CreateDirectory(dir);

 

What's your thoughts on this?

*

Protected by WP Anti Spam