473,387 Members | 1,465 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,387 software developers and data experts.

version of .net + folder browser


Hello ,I am working with
..Net Framework 1.1 - Version:1.1.4322
and Development Enviroment2003 - Version 7.1.3088.

Is this version of .Net supposed to have a normal folder browser or
might be that the version is the reason I don't have a normal folder
browser?
If not,which control could I use instead?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
16 1924
Juli Jul,

Did you try this one
{
FolderBrowserDialog fb = new FolderBrowserDialog();
fb.ShowDialog();
MessageBox.Show(fb.SelectedPath);
}

I thought that I told you in a previous version that the standart Net 1.1
version has a bug which is repared in Net SP1. However this it has to do
withouth that as well when your paths are shorter than 128 characters.

I hope this helps?

Cor
Nov 16 '05 #2
Define "normal folder browser". The options are the
System.Windows.Forms.FolderBrowserDialog or to use the SHBrowseForFolder
function in the Shell32.dll.

HTH

DalePres

"juli jul" <ju******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

Hello ,I am working with
Net Framework 1.1 - Version:1.1.4322
and Development Enviroment2003 - Version 7.1.3088.

Is this version of .Net supposed to have a normal folder browser or
might be that the version is the reason I don't have a normal folder
browser?
If not,which control could I use instead?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #3
Hello,
with the normal folder I mean the :
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
I tried to do the ShowDialog() method and all I can see is still an
empty window with no folders to choose.
Could someone help? Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4
Juli,

Did you try my code snippet?

Direct in line, by instance in a load of the form.

Cor
Nov 16 '05 #5

Hello,
Yes I tried this code and still see an empty window ,the message box
which suppose to show the path to the folder is empty (no selected
path).
Is there some solution for it?
Thank you!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #6
try STAThread. The FolderBrowserDialog does not support MTA
"juli jul" <ju******@yahoo.com> wrote in message
news:OB****************@TK2MSFTNGP12.phx.gbl...
Hello,
with the normal folder I mean the :
System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
I tried to do the ShowDialog() method and all I can see is still an
empty window with no folders to choose.
Could someone help? Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #7

Hello,
Could you please explain how to use the STAThread and how do I implement
the folder browser with it?
Thank you!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #8
Hi,

If my guess is correct. Change the attribute [MTAThread] to [STAThread] In
the Main function.

If you have to use MTAThread, the only way to show the folder browser is use
the SHBrowseForFolder function in the Shell32.dll.
Though this function doesn't support 'Make a new folder' button when you use
MTAThread.

The website http://www.netomatix.com/FolderBrowser.aspx might help you to
wrap the FolderBrower class.

Ping
"juli jul" <ju******@yahoo.com> wrote in message
news:uj**************@TK2MSFTNGP14.phx.gbl...

Hello,
Could you please explain how to use the STAThread and how do I implement
the folder browser with it?
Thank you!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #9

Hello,
I tried to make a new project with only the folder browser in it and it
works there but inside mine project it doesn't.Is it possible that this
control can't be at the same form with some other control?
Are there some kind of sources with which I could implement the folder
browser some other way?
Thanks a lot!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #10
Hi, Juli

To implement your own folder browser, That is a lot of work. personally I
don't think that is a good way to do.

What type is project? Windows Application? Please dobule check what
attributes applied to Main function.

Another way to identify if it is MTAThread problem. On your new test
project, change the STAThread to MTAThread; if you get the same result as
your project does, just change the attribute should fix your problem.

Help this helps
"juli jul" <ju******@yahoo.com> wrote in message
news:u9*************@TK2MSFTNGP14.phx.gbl...

Hello,
I tried to make a new project with only the folder browser in it and it
works there but inside mine project it doesn't.Is it possible that this
control can't be at the same form with some other control?
Are there some kind of sources with which I could implement the folder
browser some other way?
Thanks a lot!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #11
Hello,
Could you please tell me how to check those attributes in main,I tried
to read about it in the net bit somehow not sure how to do it?
Thank you very much!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #12
Hi, Juli

I can give you 2 ways to check the COM threading model.

1. find your Main function, you might find there are attributes applied to
the Main function, usually it looks like
[STAThread]
static void Main()
{
...
}
2. If you are not able to get your Main function source (I presume the
source file is owned by somebody else), you still can get the current COM
threading model by calling ApartmentState in Thread class, it looks like

using System.Threading; // you have to add this namespace

ApartmentState state = Thread.CurrentThread.ApartmentState;
// you can set breakpoint here to check the value of state. or pop up a
message box to display it.
Add this code just before your call ShowDialog function, you will know what
COM threading model the FolderBrowser is running on?

Help this helps
"juli jul" <ju******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,
Could you please tell me how to check those attributes in main,I tried
to read about it in the net bit somehow not sure how to do it?
Thank you very much!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #13

The messagebox result was that I have a MTA attribute-what does that
mean and should I change it (and how) in order to see folders in
browser?
Thanks a lot!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #14
You have to change the attribute in Main function, it should look like
[STAThread]
static void Main()
{
.....
}
find your Main function, you will notice that there is [MTAThread] attribute
just before Main function; Change it to STAThread, the FolderBrowser should
work. It is just like what I said at very beginning.

Help this helps
"juli jul" <ju******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

The messagebox result was that I have a MTA attribute-what does that
mean and should I change it (and how) in order to see folders in
browser?
Thanks a lot!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #15

Hello,
I can't see the [MTAThread] before main. I saw its value by printing the
code which detereined the attribute. How can I access it?
Thank you very much!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #16
Hello,
Thank you very very much!
The MTA attribute was my problem and now I can see folders.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #17

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

Similar topics

11
by: LarryM | last post by:
Hi, NB, not to stop capturing the single displayed Image, but to stop downloading the entire image directory. (In my Website you will do a search, and get some thumbnails, and these can be...
22
by: xmp333 | last post by:
Hi All, I am trying to hide my JavaScript source. The method I chose was to keep all the important source in a password protected folder, and then use a SRC="folder/script.js" to include it...
12
by: Russell Stevens | last post by:
Should be trivial - I want to detect the program version so that I can take steps to update things to the current version. Pretty simple - just use Application.ProductVersion So I install the...
4
by: santel_helvis | last post by:
Hi there, I wanna open the folder using asp.net. I am using anchor link to do that. But in href part how shall I give the location. Anyone plz help me out. Thanks in advance
8
by: gil | last post by:
Is it possible to prevent a browser from listing the entire contents of a folder? The site, is hosted on my ISP with the following layout- site/ "user name from ISP" pagefile (dir)...
14
by: pamela fluente | last post by:
I want to use the ordinary OpenFileDialog to choose a folder instead of a file. Is it possible? And how? -P
19
by: adminloozer | last post by:
Hello, Is there a solution to test on local HD a site under differents IE version. I use Vista and I have IE7. Can I install (with a kind of procedure) older versions of IE. I tried with...
6
by: Andy Fish | last post by:
Hi, From what I can gather, under Asp.Net 2.0, it is safe to put data and config files underneath the app_data in the web root and they will not be served directly to the browser from a URL. ...
6
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.