M
Mr. X.
Hello.
I upgrade my code from VB 6 -> VB.NET 2005 (Visual studio).
The following code was great for VB 6 :
============================
dim fs as FileSystemObject = new ...
dim ts as TextStream
dim file_name as string
.....
file_name = "a_file.txt"
ts = fs.CreateTextFile(file_name, false)
ts = nothing
**** the following line in VB.NET only, and not on VB.6 ***
ts.close()
****
When trying to delete the file by : fs.deleteFile(file_name)
it works on VB.6, but on VB.NET the remarked line (ts.close() ) is
necessary, otherwise I got "permission denied exception"
Why should I have the ts.close file on VB.NET, since I only create the file
and not open it for output ?
Is there any problem on VB.6, if I don't add the remarked line : ts.close()
?
Thanks
I upgrade my code from VB 6 -> VB.NET 2005 (Visual studio).
The following code was great for VB 6 :
============================
dim fs as FileSystemObject = new ...
dim ts as TextStream
dim file_name as string
.....
file_name = "a_file.txt"
ts = fs.CreateTextFile(file_name, false)
ts = nothing
**** the following line in VB.NET only, and not on VB.6 ***
ts.close()
****
When trying to delete the file by : fs.deleteFile(file_name)
it works on VB.6, but on VB.NET the remarked line (ts.close() ) is
necessary, otherwise I got "permission denied exception"
Why should I have the ts.close file on VB.NET, since I only create the file
and not open it for output ?
Is there any problem on VB.6, if I don't add the remarked line : ts.close()
?
Thanks