how can i create a file in a directory ?
-
Hi everybody Please can you tell me the methode allows to check if a file is existing in a directory "X" if it is then its ok if not i want to create it with some statements in please if you know write me the code & explain as much as you can thank you :) try to be good if you can't be the best
-
Hi everybody Please can you tell me the methode allows to check if a file is existing in a directory "X" if it is then its ok if not i want to create it with some statements in please if you know write me the code & explain as much as you can thank you :) try to be good if you can't be the best
You could do something like this example
Dim fs As System.IO.FileStream
Dim scrFile As System.IO.StreamWriterstrFileName = "some path and filename"
If Not IO.File.Exists(strFileName) Then
fs = New System.IO.FileStream(strFileName, IO.FileMode.OpenOrCreate, IO.FileAccess.Write)
else
'Just open file here
Endifcode is posted "as is" an is just an example. You could check out the IO namespace http://msdn2.microsoft.com/en-us/library/system.io.aspx[^] http://msdn2.microsoft.com/en-us/library/system.io.filestream.aspx[^] this will properly give you a good idea which statements you need It's my opinion that nothing is impossible, it's "just" at matter of enough knowledge, time and money.