Question: C# Windows form app I have errors that i do not understand. Can someone please help me fix the issue. Im using the dateTimePicker to
C# Windows form app
I have errors that i do not understand. Can someone please help me fix the issue. Im using the dateTimePicker to grab its dates and convert them to strings and get the dates between and all store them in a list. Once in the datesbetween list im using them to filter files in a directory by the file name which is the date (ex. 20180323_mercedes.csv). I need help with following errors.
List
********************************************************************************************************** syntax :
private void button2_Click(object sender, EventArgs e) { string earliestdate = dateTimePicker1.Value.ToString("yyyyMMdd"); string latestdate = dateTimePicker2.Value.ToString("yyyyMMdd"); DateTime earliestDate = DateTime.ParseExact(earliestdate, "yyyyMMdd", CultureInfo.InvariantCulture); DateTime latestDate = DateTime.ParseExact(latestdate, "yyyyMMdd", CultureInfo.InvariantCulture);
List
if (checkedListBox1.GetItemCheckState(0) == CheckState.Checked) { if (checkedListBox2.GetItemCheckState(0) == CheckState.Checked) { fileDirectories.Add("...................") } else if (checkedListBox2.GetItemCheckState(1) == CheckState.Checked) { fileDirectories.Add("...................");
} else if (checkedListBox1.GetItemCheckState(2) == CheckState.Checked) {......} foreach (string selectedPath in fileDirectories) { string[] level1 = Directory.GetFiles(selectedPath, DatesBetween(earliestDate, latestDate) + ".csv", SearchOption.AllDirectories); foreach (string level2 in level1) { //Construct.pathList.Add(level2);
....................................................
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
