string Date1 = dateTimePicker1.Value.ToString("ddMM");
foreach (string file in Directory.GetFiles(@"C:\tbank_file\out\", "*.txt"))
{
MessageBox.Show(file);
}
我想在getfile的循环foreach中使用变量date1
答案 0 :(得分:0)
string Date1 = dateTimePicker1.Value.ToString("ddMM");
foreach (string file in Directory.GetFiles(@"C:\tbank_file\out\", "*.txt"))
{
MessageBox.Show(file+" "+ Date1);
}
答案 1 :(得分:0)
foreach (string file in Directory.GetFiles(@"C:\tbank_file\out\", "*.txt"))
{
MessageBox.Show(file+" "+ dateTimePicker1.Value.ToString("dd/MM/yyyy"););
}