When I try to download an excel file using C# Web client the default saved location is the bin folder
public void downloadCSVResult(string ssid,string thoken)
{
using (var client = new WebClient())
{
client.Credentials = new NetworkCredential(ssid, thoken);
string url= "https://api.twilio.com/2010-04-01/Accounts/"+ssid+"/SMS/Messages.csv";
client.DownloadFile("https://api.twilio.com/2010-04-01/Accounts/"+ssid+"/SMS/Messages.csv", "Messages.csv");
}
Process.Start(@"\\SMSLogs");
I have added a folder called SMSLogs inside the project and I want to download to this specific folder
But When I try to download and to open the folder using explorer :
client.DownloadFile("https://api.twilio.com/2010-04-01/Accounts/"+ssid+"/SMS/Messages.csv", "SMSLogs\\Messages.csv");
}
Process.Start(@"\\SMSLogs");
I receive an error
{"Could not find a part of the path 'C:\SMSLogs\Messages.csv'."}
But I don't want to save it in the C: directory because once I give the application to the client , It be good to have a directory called SMSLogs and inside of it the excel file
What I'm doing wrong?
Thanks