Release File

  • Thread starter Thread starter Tlink
  • Start date Start date
T

Tlink

I execute the following code and the created file cannot be deleted as it
reports it is being used, even when I reboot the machine.

Private WFilename As String = "data.txt"

File.Move(txtcontrolfile.Text, FolderBrowserDialog1.SelectedPath & "\" &
WFilename)

File.Delete(inifile)

wfile = File.CreateText(inifile)

wfile.WriteLine(FolderBrowserDialog1.SelectedPath & "\")

wfile.Flush()

wfile.Close()
 
Hi Tlink,
I execute the following code and the created file
cannot be deleted as it reports it is being used,
even when I reboot the machine.

I perform some research and tests with your sample code, I haven't
experienced such a problem on my side.

But I am not very clear about the string inifile and the purpose of the
File.Move() operation, would you please tell me more detailed info about it?


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
 
Back
Top