I do reference another class named Config, but that is not where the problem lies. the issue is when the network path is passed through "Filename" it adds more "\"'s
Example
txtdataPath.Text ="\\server\folder\file"
If i were to put a linebreak over "Filename" it would read
\\\\server\\folder\\file
private void btnTest_Click(object sender, EventArgs e)
{
string Filename = txtdataPath.Text;
string un = txtuserName.Text;
string pw = txtPassword.Text;
//Validation
if (string.IsNullOrEmpty(Filename))
{
MessageBox.Show("Please Load your Dictionary File");
}
else if (!Filename.Contains("\\"))
{
MessageBox.Show("Please Enter UNC path");
goto Finish;
}
//Test cnnectin
config Config = new config();
Config.testConnection(un, pw, Filename);
Finish: ;
}
Has this ever happened to anyone else? i really dont see why this is happening. the wrong datapath means wrong connection string..
I'm totally new to C# ive been converted from VB
Example
txtdataPath.Text ="\\server\folder\file"
If i were to put a linebreak over "Filename" it would read
\\\\server\\folder\\file
private void btnTest_Click(object sender, EventArgs e)
{
string Filename = txtdataPath.Text;
string un = txtuserName.Text;
string pw = txtPassword.Text;
//Validation
if (string.IsNullOrEmpty(Filename))
{
MessageBox.Show("Please Load your Dictionary File");
}
else if (!Filename.Contains("\\"))
{
MessageBox.Show("Please Enter UNC path");
goto Finish;
}
//Test cnnectin
config Config = new config();
Config.testConnection(un, pw, Filename);
Finish: ;
}
Has this ever happened to anyone else? i really dont see why this is happening. the wrong datapath means wrong connection string..
I'm totally new to C# ive been converted from VB