我有三个下拉列表。从这三个中,我必须选择各种路径来检索一个文件夹。问题是路径无法检索文件夹并给出错误找不到路径的一部分。我的代码是。
protected void Btn_Load_Click1(object sender, EventArgs e)
{
string _username = ConfigurationManager.AppSettings["ImpersonatedUserName"].ToString();
string _password = ConfigurationManager.AppSettings["ImpersonatedPassword"].ToString();
string _domain = ConfigurationManager.AppSettings["ImpersonatedDomain"].ToString();
Impersonation objImpersonation = new Impersonation();
if (objImpersonation.impersonateValidUser(_username, _domain, _password))
{
string PathFecha = ConfigurationManager.AppSettings.ToString() + "\\Convert.ToString(Drp_List1.SelectedItem)\\Convert.ToString(Drp_List2.SelectedItem)\\Convert.ToString(Drp_List3.SelectedItem)\\";
string[] files = System.IO.Directory.GetFiles(PathFecha);
foreach (string filename in files)
{
ListBox1.Items.Add(new ListItem(System.IO.Path.GetFileName(filename), filename));
}
}
}