Solved

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

Posted on 2009-05-14
2
226 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 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