Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27511

VS 2012 File Used by Another Process (Timer)

$
0
0
Hey Everyone -

I have a little snag. I have this code on a timer
Code:

My.Computer.FileSystem.WriteAllText("C:\test\jesterlog.txt", tbLog.Text, True)
. It runs fine the first time, but when the timer ticks the second time I get the error "The process cannot access the file 'C:\test\jesterlog.txt' because it is being used by another process." Is there a simple way to just close the file? This seems very simple but I'm not seeing a clear cut way to just dispose or close the file. Thanks!

Viewing all articles
Browse latest Browse all 27511

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>