Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-14
2
Medium Priority
?
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
csenasa earned 750 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 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