Handling OS Path characters in a .NET TextBox so the double backslash does not appear after reference in code.
Posted on 2006-11-27
I am having a problem retreiving the path info when entered into a textbox. For example.
I can read this path when referenced in code: string myPath = @"C:\DATA\text.txt.
However I am not sure how to implement this when grabbing the string from input in a TextBox.
So it the user enters the same path in the TextBox C:\DATA\text.txt.
Then I am not sure how to handle it. I tried to concate the string with the @ char but that didn't work. ie: string myPath = "@" + textBox1.Text.ToString();