473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with OpenFile dialog

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

Jun 27 '06 #1
1 1236
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
"Sean Campbell" <Se**********@discussions.microsoft.com> wrote in message
news:49**********************************@microsof t.com...
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

Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Irmen de Jong | last post by:
Hi, I'm having trouble with the code below. It's just a regular Tk text widget in which you can type and select text as expected, however the call to tkFileDialog.askopenfilename() seems to screw...
0
by: dieter grobler | last post by:
Hi there, I wanted to know if there is a way to specify the default location the OpenFileDialog shows when the browse button is pressed on the FileUpload Control. i.e "c:\program files\". I know...
7
by: garyusenet | last post by:
This is the first time i've worked with openfile dialog. I'm getting a couple of errors with my very basic code. Can someone point out the errors in what i've done please....
4
by: garyusenet | last post by:
The following code was supplied by a kind poster as a solution to a problem i was having. But it's not quite working. I have commented the code myself below. Can you please read my comments to make...
7
by: nergal | last post by:
Hi, I've been staring myself blind on the same little code now and I cant see the problem. The filepointer seems to not change when I open it in a function. I've written like this (a bit pseudo...
4
by: Marco Trapanese | last post by:
Hi! I show an OpenFile Dialog with: dlgOpen.ShowDialog() but I'd like to change the default view among Detail, Thumbnail, Icons, ect. Users change the view mode by this button: ...
0
by: jaeden99 | last post by:
I have created a datagrid filled with information from the database. When a user clicks on a particular cell (this cell contains drive letter and file name), I would like to be able to open the...
2
by: TBMAN | last post by:
This script below is having problems with allow the selestion of *.mdb files off the network. Can anyone see the problem with the code? Function ImportFile(strform As Form) As Boolean Dim...
4
by: manojspromantr | last post by:
Hi Friends I am trying to design a form where i need to browse a excel file using a open dialog box & append the same in a Table at the database.Any how i have taken care that the Table fields are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.