473,796 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Restrict the user to a particular folder in OpenFileDialog Control

Hi Friends,

Can anyone please help me with the OpenFileDialog Control in VB.Net? I want
the user to be restricted to a particular folder only for selecting a file,
i.e. they should not be able to change the directory in the OpenFileDialog!

Is there a way to implement this? Please let me know.

Thanks,
Paras Wadehra

You One Stop Entertainment Guide - http://www.paras.2ya.com/
Jul 21 '05 #1
1 5785
Hi,

There is no way in the Manged Open File Dialog to restrcit the user from
selecting from a particular directory only. I would suggest you use a listbox
and populate it with Directory.GetFi les listings to list all the files in
your current directory and then allow the user to choose only amongst them.

Regards,
Saurabh Nandu
[ www.AksTech.com ]
[ www.MasterCSharp.com ]

"Paras Wadehra" wrote:
Hi Friends,

Can anyone please help me with the OpenFileDialog Control in VB.Net? I want
the user to be restricted to a particular folder only for selecting a file,
i.e. they should not be able to change the directory in the OpenFileDialog!

Is there a way to implement this? Please let me know.

Thanks,
Paras Wadehra

You One Stop Entertainment Guide - http://www.paras.2ya.com/

Jul 21 '05 #2

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

Similar topics

2
1662
by: Peter | last post by:
Hello! Please, could anybody tell me, is it possible to run an asp page as particular user? I have this situation where I have one shared folder on particular server and this folder is shared for just one user to access it. I wrote an asp page wich should open a file from that shared folder. However because the folder is shared for just one user I have somehow to run the asp page as this user. The same way like in ASP.NET application...
11
2313
by: Mr. B | last post by:
If you can set the 'initial' path of an OpenFileDialog box by something like the following: Dim FilesPath As String ' Files Path FilesPath = "P:\Projects\" FilesPath = OpenFileDialog1.InitialDirectory HOW can you set a 'current' path? For example:
3
3470
by: juststarter | last post by:
Hello all, I am using an openFileDialog box to select a file (in order to insert it in a database). When the file is selected i am filling a few textboxes with the actual path, filename and extension of the file, so i no longer need the openfiledialog, thus i am using openfiledialog1.reset() method to reset it. (i have also tried openfiledialog.dispose() with no results) The problem i am encountering is that the folder in which the...
1
265
by: Paras Wadehra | last post by:
Hi Friends, Can anyone please help me with the OpenFileDialog Control in VB.Net? I want the user to be restricted to a particular folder only for selecting a file, i.e. they should not be able to change the directory in the OpenFileDialog! Is there a way to implement this? Please let me know. Thanks, Paras Wadehra
5
4098
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
4
7598
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from ASP.mypage_blalala_aspx to MyPage. Stupid namespace ASP doesn't have that class name. I can't even put any base classes to that crazy App_Code folder to get the class reference. Am I doing something wrong? All I want to do is during click to access a mainpage...
1
3784
by: sam | last post by:
OpenFileDialog appears to be "holding onto" the parent folder of a selected file until the application using the dialog quits. After creating a folder containing a file, I attempted to select that file with an OpenFileDialog. I used the following code to create the dialog: Dim a As New OpenFileDialog a.ShowDialog() a.Dispose()
6
3162
by: kimiraikkonen | last post by:
Hello, I have a listbox and folder browser control. I need to display all .mp3 files' pathes into listbox. It was Ok with openfiledialog but how can list all .mp3 extension- having files into my listbox using folder browser control. A sample code would be great.
5
2296
by: gracepaul | last post by:
hi, I had created a web application in c#. It is uploaded and going smoothly. Now the request of the client is to restrict the access of their site. They want access only in some machines(Not in world wide). The restriction cannot be done by using IP address. I have a logic to implement this. Create a particular folder in all the client machines. Then check for this particular folders existance during run time. If the folder exists then...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.