Forum  General Visual ...  How do I...?  openfileDialog stream is never close?
Previous Previous
 
Next Next
New Post 6/4/2008 12:06 PM
  calipsio
61 posts
www.symbiosetech.com
No Ranking


openfileDialog stream is never close? 
Hi guys

Suppose I have a form with a button and a openfiledialog.

Here's my code :
Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fs As New IO.StreamReader(OpenFileDialog1.OpenFile, System.Text.Encoding.GetEncoding("iso-8859-1"))
fs.Close()
fs.Dispose()
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
OpenFileDialog1.ShowDialog()
End Sub
End Class



I choose a file (test.txt).
I click the button1 once.
I click the button1 twice -> error because the stream on the file is never close.. Could we have a "OpenFieldDialog.CloseFile()" methods in future?
Thanks
Francois
 
New Post 6/5/2008 9:38 AM
  itzik.spitzen
1659 posts
1st Level Poster




Re: openfileDialog stream is never close? 
Hi Francois,

We will sure validate the issue and see if we can add such method. Please track the issue here.

Regards,
Itzik Spitzen
 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  openfileDialog stream is never close?
CompanionKit Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS