Problem with OpenFile dialog

G

Guest

Hi all!

I have a problem with the OpenFile dialog that I use in my program.

I created a Browse button to allow for the selection of a text file that is
processed by my program. The Browse button works perfectly when the .EXE is
on my station. If I copy the .EXE to a network drive, the Browse button stops
functioning. I have never seen this happen before.

I created my program with VB 2005. Is this a known problem or did I code
something wrong. Here is the code for my Browse button:


Private Sub btn_Browse_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_Browse.Click
'Declare the local variables
Dim ofd As New OpenFileDialog()
FALPath = ""

Try
'Define the OpenFileDialog to obtain the raw FAL data
ofd.InitialDirectory = "C:\"
ofd.Filter = "fichiers fal (*.FAL)|*.FAL"
ofd.FilterIndex = 1
ofd.RestoreDirectory = True
ofd.Multiselect = False

If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
FALPath = ofd.FileName
txt_FALPath.Text = FALPath
End if

Catch ex As Exception
'Insert the Exception Handling code
End Try

End Sub

I hope someone can enlighten me on this problem. Thanks.


Sean
 
R

ronchese

What the error message?

And to you executable work in a network drive, you need to set special
permissions in "Manage Code Access Security Policy" in the .Net
Configuration (see on the Windows Control Panel > Administrative Tools)

[]s
Cesar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top