Solved

how to set default in intial directory as Desktop in any system using open filedialog control

Posted on 2009-05-14
2
224 Views
Last Modified: 2013-12-17
HI,

In my requirement, in my form one browse button is there. when ever we click the browse button, i need to locate csv files in the Desktop only(means, after that their wish to locate another location) in any system.

But i unable to get bydefault desktop, it always goes Documents.

plz help on this.
thanx.
0
Comment
Question by:BDPL
2 Comments
 
LVL 3

Accepted Solution

by:
csenasa earned 250 total points
ID: 24392756
Hi,

Code in the snippet wil the work for U!!!

  // Create a Dialog Object

            OpenFileDialog dialog = new OpenFileDialog();
 

            // Get the DEsktop folder path....

            dialog.InitialDirectory = Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory).ToString();
 

            // Show dialog!!!!!

            dialog.ShowDialog();

Open in new window

0
 

Author Comment

by:BDPL
ID: 24392832
Hi,

Its working fine.

Thank you very mcuh
bye
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now