Hourly inventory updates

This commit is contained in:
2025-04-04 00:18:03 +00:00
parent cbf7bb8de6
commit 857f94c59a
5 changed files with 149 additions and 119 deletions

View File

@@ -85,8 +85,6 @@ namespace PartSource.Automation.Services
public string Download(string filename, string destination = null)
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(new Uri($"{_ftpConfiguration.Url}/{filename}"));
request.Credentials = new NetworkCredential(_ftpConfiguration.Username, _ftpConfiguration.Password);
request.Method = WebRequestMethods.Ftp.DownloadFile;
@@ -116,5 +114,15 @@ namespace PartSource.Automation.Services
return destination;
}
public void Delete(string filename)
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(new Uri($"{_ftpConfiguration.Url}/{filename}"));
request.Credentials = new NetworkCredential(_ftpConfiguration.Username, _ftpConfiguration.Password);
request.Method = WebRequestMethods.Ftp.DeleteFile;
using FtpWebResponse response = (FtpWebResponse)request.GetResponse();
}
}
}