i have designed a windows forms which has a textbox in it,in that textbox i will enter path and on click of button i will bind that data to database(mysql) and i am done with it.but if the entered path contains '\'(escape character) it will be ignored while binding for e.g, if E:\folder is path it will be entered as E:folder into database,and user wont enter \\ when entering a path,how to solve this prob,
private string filepath(string FilePath)
{
char[] splitpath=FilePath.ToCharArray();;
for(int i=0;i<splitpath.Length;i++)
{
char s=splitpath[i];
if (c == '\')//error at this line
{
string path= s.Replace('\' , '\\');//error at this line also
}
}
return path;
}
errors are
too many character in character literal(CS1012)
new line in constant(CS1010)
unexpected character(CS1056)
thanks in advance,