Hello, and thank you.

I am trying to read in user defined input from a text box and use that input as a txt file name.

The problem I am having is when I read the text "test" in I am getting

"System.Windows.Forms.TextBox, Text: test"

When I try and write the file test.txt I get the exception "The given path's format is not supported."

The code:

string profileName1 = "C:\\";
char [] profileName2 = new char[profileNameBox.TextLength];
string placeHolder = profileNameBox.ToString();


try
{
StreamWriter writer;
writer = File.CreateText(profileName1 += placeHolder += ".txt");
writer.WriteLine("This works");
writer.Close();
Console.WriteLine("TXT file Created");
}
catch (Exception ex)
{
MessageBox.Show("Exception: " + ex.Message);
}

So Id like to know how I can get ONLY the text value into my variable with out the extra system notation. Thank you.