TheWizardofInt
Well-known member
I use this code to convert a string to a file:
It creates the file, but doesnt release it. When I try to access the file, it is in use by another program until I reset IIS
Anyone seen this before?
Code:
Private Function MakeFile(ByVal s As String) As String
Dim sPath As String
Dim sw As IO.StreamWriter
If Not IO.Directory.Exists(Server.MapPath("./documents")) Then
IO.Directory.CreateDirectory(Server.MapPath("./documents"))
End If
sPath = Server.MapPath("./documents") & "\transfer.xml"
sw = New System.IO.StreamWriter(sPath, True)
sw.Write(s)
sw.Flush()
sw = Nothing
Return sPath
End Function
It creates the file, but doesnt release it. When I try to access the file, it is in use by another program until I reset IIS
Anyone seen this before?