VB6 migration sky
 
  Forum  General Visual ...  How do I...?  openfileDialog stream is never close?
Previous Previous
 
Next Next
New Post 6/4/2008 11:06 AM
  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 8:38 AM
  itzik.spitzen
1600 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?
Most promising startups
Top 3 most promising startups in 2009
   AJAX Framework | Web Development | Cloud applications | RIA Development | Silverlight Applications | Legacy Migration
The most popular open source Ajax applications framework for enterprises | Sitemap | Terms Of Use | Privacy Statement
Copyright © 2005-2009 Visual WebGui®    Design By: Template World
   
Visual Studio Partners