@denesh neupane , based on my test, I suggest that you don't use 2022/03/07 the format in the path. Becuase windows limit that the file name can not contain the / character.
You could check it manually as the following:
If you still want to use datetime formart to name the path, I suggest that you could use the following code:
File.WriteAllText(folderPath + DateTime.Now.ToString("yyyy-MM-dd") + ".csv", csv, Encoding.UTF8);
Like the following pic:
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.