コード例 #1
0
        public void download(Download download)
        {
            DirectoryInfo dir = new DirectoryInfo(Setting.BASE_PATH);
            if (!dir.Exists)
                dir.Create();

            string filename = Path.Combine(Setting.BASE_PATH, download.Filename);
            WebClient Client = new WebClient();
            Client.DownloadFile(download.URL, filename);
        }
コード例 #2
0
 public int process(String clipText)
 {
     Console.WriteLine("is matching: " + Regex.IsMatch(clipText, exp));
     if (Regex.IsMatch(clipText, exp))
     {
         string filename = createFileName(clipText);
         Console.WriteLine("file name: " + filename);
         Download download = new Download()
         {
             Filename = filename,
             URL = clipText,
         };
         downloadService.download(download);
         nextNumber++;
     }
     return nextNumber;
 }