waheedrafiq
New member
- Joined
- Nov 19, 2013
- Messages
- 2
- Programming Experience
- Beginner
Hi guys i am so lost with this particular error
Objective is to write a word from textbox to a text file here is my code:
I have look , over it again , and again try so many different example from different sites unable to fix this problem.
all I get when I compile is The process cannot access the file " file path" because it is being used by another process
now I have check task manager and there is no other process using this file , closed all other possible windows so i am only left with the IDE and compiler but still not good
I have attach some screen shots please , please correct my logics o one more thing i have try at the top of the form imported the IO
so above public class frmMain line one Imports System.IO
Objective is to write a word from textbox to a text file here is my code:
Dim FILE_NAME As String = "C:\Users\waheedrafiq\Dropbox\University BCU\Visual Basic ICT\Basic_AI\EnglishSpellingABC\englishspelling.txt" If System.IO.File.Exists(FILE_NAME) = True Then Dim objWriter As New System.IO.StreamWriter(FILE_NAME) objWriter.Write(txtUserInput.Text) objWriter.Close() MsgBox("Text written to file") Else MsgBox("File Does Not Exist") End If End Sub
I have look , over it again , and again try so many different example from different sites unable to fix this problem.
all I get when I compile is The process cannot access the file " file path" because it is being used by another process
now I have check task manager and there is no other process using this file , closed all other possible windows so i am only left with the IDE and compiler but still not good
I have attach some screen shots please , please correct my logics o one more thing i have try at the top of the form imported the IO
so above public class frmMain line one Imports System.IO