Hello!
Got a problem with my project in VB 2008.
The thing is that when i press "Save" (Button1) This message shows; "VB can't access file because it's being use from another proccess." (Or something like that)
Here's my code:
What can I do to fix the problem?? Please helpCode:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim texttosave As String texttosave = TextBox1.Text Dim Filename As String Filename = Txtsave.Text Dim Location As String Location = Textsaveto.Text Dim filetype As String filetype = Combosave.Text Dim Cfile As String Cfile = Location & Filename & filetype Dim file As System.IO.FileStream file = System.IO.File.Create(Cfile) My.Computer.FileSystem.WriteAllText(Cfile, texttosave, True) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click FolderBrowserDialog1.ShowDialog() Textsaveto.Text = FolderBrowserDialog1.SelectedPath & "\" End Sub
Thanks in advance!![]()






Reply With Quote