Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileStream problem

Status
Not open for further replies.

borgrulze

Programmer
Apr 4, 2002
11
IN
Hi,

i have this line in my code

FileStream fileStream = new FileStream(Filename,FileMode.Create);

now the problem is that FileName may contain something like "c:\myfiles\images\bg.gif". suppose images directory does not exists how do make sure that the directory gets created???

that is some directories which do no exist in the path i want it to get created how do i do that??

bye
 
Hi,
You should look and use the Directory class which provide for you everything about directories.
Directory.Exists()
Directory.CreateDirectory()
Directory.CreateSubDirectory();
....
obislavu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top