I have a path like this and I want to convert this into an environmental path
Directory.GetFiles(“C:\Users\sathishpc\Downloads\reports”+DateTime.Now.AddDays(0).ToString(“dd.MM.yy”)+" 01\csv",“*.csv”)
I have a path like this and I want to convert this into an environmental path
Directory.GetFiles(“C:\Users\sathishpc\Downloads\reports”+DateTime.Now.AddDays(0).ToString(“dd.MM.yy”)+" 01\csv",“*.csv”)
Can you try the below syntax:
Directory.GetFiles(Path.Combine("C:\Users\sathishpc\Downloads\reports", DateTime.Now.AddDays(0).ToString("dd.MM.yy") + " 01", "csv"), "*.csv")
Regards
not like this i want using like this example: Directory.GetFiles(Environment.ExpandEnvironmentVariables("%USERPROFILE%\Downloads\reports"), “*.csv”)
Can you try this once:
Directory.GetFiles(Environment.ExpandEnvironmentVariables("%USERPROFILE%\Downloads\reports"), "*.csv")
Regards
Directory.GetFiles(Environment.ExpandEnvironmentVariables(“%USERPROFILE%\Downloads\reports”+DateTime.Now.AddDays(0).ToString(“dd.MM.yy”)+" 01\csv"), “*.csv”)
this one worked thanks for your reply
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.