Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET File I/O and Registry (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/)
-   -   System.IO issue for a newb (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/327172-system-io-issue-newb.html)

SwsCheez 07-14-2014 05:19 PM

System.IO issue for a newb
Can anyone tell me why I get an error stating that the file is still is still in use and it bombs with an IO exception:

"The process cannot access the file 'C:\Users\Ken\Dropbox\Test Files\Select A Category\Select A Sub-Category\textbox1.text & " " & textbox2.text.xml' because it is being used by another process. Below is my code:

If System.IO.Directory.Exists(TextBox57.Text & "\Select A Category\Select A Sub-Category\") = False Then
System.IO.Directory.CreateDirectory(TextBox57.Text & "\Select A Category\Select A Sub-Category\")
End If

'System.IO.File.Create(TextBox57.Text & "\Select A Category\Select A Sub-Category\" & TextBox1.Text & " " & TextBox2.Text & ".xml")

Dim Writer3 As XmlTextWriter = New XmlTextWriter(TextBox57.Text & "\" & ComboBox3.Text & "\" & ComboBox6.Text & "\" & TextBox1.Text & " " & TextBox2.Text & ".xml", System.Text.Encoding.UTF8)

If ComboBox3.Text <> "Select A Category" Then


' Create the root element named Resume Entry

' Start a child element named Client

' Create a number for the First Name

' Create a name for the Last Name

' Close the student node

' Close the root element



End If

Cerian Knight 07-15-2014 02:26 AM

If I had to guess, the literal of 'textbox1.text' showing up in the error file means that you have quotes or similar in the textbox interfering with the concatenation. Try displaying the string within 'Dim... New XmlTextWriter' to be sure.

All times are GMT -6. The time now is 09:06 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.