?
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
?
233 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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

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.   …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 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