귀하의 솔루션은 3 단계에있을 것입니다 : URL에서
1. 파일 다운로드
가지고 System.Net.WebClient
using (WebClient Client = new WebClient())
{
Client.DownloadFile("http://www.abc.com/file/song/a.mpeg", "a.mpeg");
}
2. 압축을 풀고 봐 파일
.Net 4.5의 경우 System.IO.Compression.ZipFile
에서 볼 수 있습니다.
string startPath = @"c:\example\start";
string zipPath = @"c:\example\result.zip";
string extractPath = @"c:\example\extract";
ZipFile.CreateFromDirectory(startPath, zipPath);
ZipFile.ExtractToDirectory(zipPath, extractPath);
아니면 더 강력한 솔루션은 압축을 해제하려면 아마 SharpZipLib
들여다
3. 스케줄러
당신이 System.Timers
볼 수 ;
public void MyMethod()
{
Timer timer = new Timer();
timer.Interval = new TimeSpan(0, 15, 0).TotalMilliseconds;
timer.AutoReset = true;
timer.Elapsed += new ElapsedEventHandler(Timer_Elapsed);
timer.Enabled = true;
}
public void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
//Do your stuff here
}
이들을 결합하고 솔루션을 코딩하십시오.
빠른 응답을 위해 Loki에게 감사드립니다 .... – ShubhVinay
@ Loki- CreateFromDirectory (startPath, zipPath); 및 ExtractToDirectory (zipPath, extractPath); 당신이이 일을하도록 안내 한 방법. – ShubhVinay
@ShubhVinay 'System.IO.Compression.FileSystem'에 대한 참조를 추가해야합니다. 그런 다음 라이브러리에'using System.IO.Compression'을 포함시키고 ZipFile.CreateFromDirectory 또는 ZipFile.ExtractToDirectory를 호출하십시오. – Loki