I'm creating a very simple application that will select files from local drive or from PC connected in a network.
Application has a "checkbox"
that can be checked True or False.
Is it right to connect from Network location??
How can I create file browse button with it?
private void connect()
{
try
{
if (checkbox1.Checked == false)
{
FilePath = @"C:\FILE";
}
else
{
FilePath = @"\\192.168.0.2\file\"; // That I want Is it work?
}
strConn = @"Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + FilePath + @"\;Extensions=csv,txt";
Connect = new OdbcConnection(strConn);
Connect.Open();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
}
You want to open a file browser on the network ? Did you try
OpenFileDialog
? It works on network path too, You can use it like this: