I have a strange problem that is bugging me. I have a VB.NET 2010 program that works great opening, converting,writing to a new file and saving the converted output to a new text file at a different location. However, I want to delete the original input file once I am done with it but it just won't go away. Also, I am logged in as an administrator on the machine I am running this on.
Here are the pertinent lines that are being used that refer to my issue:
Imports System.IO
CODE
InName = "F:\WWTP\op10.imp" 'Input file path
CODE
oRead = IO.File.OpenText(InName) 'Open the input file (This works just fine & outputs to different path variable)
CODE
System.IO.File.Delete(InName) 'Delete the input file (This does nothing and the file is still there after the program finishes)
I've even tried dropping the "System.IO" part because I saw an example like that somewhere. Any suggestions would be greatly appreciated.
Thanks in advance,
Al
Here are the pertinent lines that are being used that refer to my issue:
Imports System.IO
CODE
InName = "F:\WWTP\op10.imp" 'Input file path
CODE
oRead = IO.File.OpenText(InName) 'Open the input file (This works just fine & outputs to different path variable)
CODE
System.IO.File.Delete(InName) 'Delete the input file (This does nothing and the file is still there after the program finishes)
I've even tried dropping the "System.IO" part because I saw an example like that somewhere. Any suggestions would be greatly appreciated.
Thanks in advance,
Al