Quantcast
Viewing all articles
Browse latest Browse all 77050

How to create new file directory?

I wanna create a file directory, so that I can put the new created file into this new directory.

    var documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
    var newDocPath = Path.Combine(documentsPath, documentsPath);
        var filePath = Path.Combine (newDocPath, filename);
        System.IO.File.WriteAllText (filePath, text); // Could not find a part of the path ".../Documents/newDocPath/filename.jpg", 
                                          //I understand newDocPath is not existing yet, but how can I create a new sub dir inside Documents folder?

Thank you


Viewing all articles
Browse latest Browse all 77050

Trending Articles