FolderBrowserDialog fd = new FolderBrowserDialog();
strPassKey = tea.Decrypt(strPassKey, "HPPower");
DialogResult result = fd.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
{
string[] files = Directory.GetFiles(fd.SelectedPath); // fd.SelectedPath contains the path of folder with files
foreach (var xfile in Directory.GetFiles(fd.SelectedPath, "*.xml"))
{
xWorkloadDoc.Load(xfile);
foreach (var decryptfile in Directory.GetFiles(fd.SelectedPath, "*.xml"))
{
string foldrpth = xfile.Replace(decryptfile, ""); // string gives null
}
}
}
fd.SelectedPath
包含文件夹中文件的路径。我们可以在字符串foldrpth
中获取此路径吗?