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 6943501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:09:53+00:00 2026-05-27T13:09:53+00:00

I am using folderdialogbox in one of my application. When a directory is selected

  • 0

I am using folderdialogbox in one of my application. When a directory is selected and assigned to another string, I get a value like C:\\test

For some of the assignments, I would like the value of c:\test.

I researched on stackoverflow, but did not find any working answer. I tried all kind of replacement, but it does not work.

Any help will be greatly appreciated.

The Codes:

private void label1_Click(object sender, EventArgs e)
    {
       folderBrowserDialog1.ShowNewFolderButton = false;

        if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
        {
            string p = @folderBrowserDialog1.SelectedPath; //=> Selected C:\ACTNT
            //removing @ in front of folderBrowserDialog1 does not change the situation
            strPathName.Text = p; // => display c:\ACNT
            con = "database = " + p; // => actual value "database = c:\\ACNT"
            UpdateTableName();
        }
    }

If I type manually in strPathName as C:\ACNT , the program runs fine.

  • 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-27T13:09:53+00:00Added an answer on May 27, 2026 at 1:09 pm

    The other answers so far are talking about assigning string literals, but it sounds like you’re getting this string via a GUI anyway, in which case that’s irrelevant.

    What is relevant is how you’re determining that the string is actually c:\\test. I strongly suspect you’re looking at it in the debugger – which automatically applies C# escaping when it displays the string.

    If you just print it to the screen, or even example it character by character (e.g. call ToCharArray()) I think you’ll find it only has a single backslash. Don’t be fooled by the debugger.

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

Sidebar

Related Questions

Using the HTML5 File API I can get the Binary String representation of a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
Using Rails 3.2.0 with haml and sass: I Would like to link an external
Using jQuery, one can easily find out whether a particular element is visible using
Using NSDateComponents I know how to get the day component, but this gives me
Using mercurial, I've run into an odd problem where a line from one committer
Using Android TelephonyManager an application can obtain the state of data activity over the
using file_get_contents , I open an Internet URL and get the contents of this

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.