Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 601897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:45:52+00:00 2026-05-13T16:45:52+00:00

App.config: <add key=SaveDraftPath value=C:\Drafts\/> C#: var saveDraftPath = ConfigurationManager.AppSettings[SaveDraftPath]; var sfDialog = new SaveFileDialog();

  • 0

App.config:

<add key="SaveDraftPath" value="C:\Drafts\"/>

C#:

var saveDraftPath = ConfigurationManager.AppSettings["SaveDraftPath"]; 
var sfDialog = new SaveFileDialog();
sfDialog.InitialDirectory = saveDraftPath;
sfDialog.FileName = "FILE";

For some reason this doesn’t open the filebrowser in the path like planned, any one know why or how to fix?

I’ve tried this now, still doesn’t work:

var saveDraftPath = Path.GetFullPath(ConfigurationManager.AppSettings["SaveDraftPath"]);
MessageBox.Show("does directory exist : " + Directory.Exists(saveDraftPath));
var sfDialog = new SaveFileDialog();
sfDialog.InitialDirectory = saveDraftPath;
sfDialog.FileName = "FILE";

and Directory.Exists(saveDraftPath) returns true.. Hmmm?!

Edit: The above code has worked once for me. The code works for everyone who has so far answered. But it is still not working. So I suspect the problem is some sort of local/history setting stopping it. Does anyone know why this might happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:45:53+00:00Added an answer on May 13, 2026 at 4:45 pm

    Try this:

    var path = Path.GetFullPath(ConfigurationManager.AppSettings[“SaveDraftPath”])

    Have a look at Path Class as well, has got several helpful methods

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my App.Config <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=lang value=English/> </appSettings>
I need to insert key value pairs in app.Config as follows: <configuration> <appSettings> <add
I have some key/value config values in a .Net app.config file <configuration> <appSettings> <add
App.config: <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=1 value=An error occured.\r\nPlease try again
My App.Config is something like: <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=foo value=/>
Here's the line from App.Config: <add key=CheckFileFormatString value=P{0}\t&quot;{1}, {2}&quot;\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}/> Here's the code that puts
Application is running in my local system app.config file <add key=dbconn value=Data Source=(local);database=VTech;User ID=sa;Password=sa;
In the app.config file if I use <add key = FileDelimeter value =&#2c;/> as
In my app.config file I made the setting like the following <add key =
By appSettings-like I mean like this, <appSettings> <add key=myKey value=myValue /> </appsettings> The result

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.