KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a piece of code here that breaks if the directory doesn't exist: System.IO.File.WriteAllText(filePath, content); In one line (or a few lines), is it possible to check if the directory leading to the new file doesn't exist and if not, to create it before creating the new file? I'm using .NET 3.5.
Tags (comma-separated)
Save Edits
Cancel