예제 #1
0
파일: Program.cs 프로젝트: ouaiea/miseruge1
 static void DownloadResources(string[] fileList)
 {
     //ライブラリ EXEファイルのダウンロード
     Parallel.ForEach(fileList, (string it) => {
         try {
             DownloadParameter parameter = new DownloadParameter(it);
             string savePath = Path.Combine(HomeDirectory, parameter.FileName);
             //ファイルの内容は、ファイル名=ダウンロード先のURLとする。
             //set[0]=ファイル名
             //set[1]=ダウンロードパス
             //set[2]=上書きか否か(y, n)
             Trace.WriteLine(parameter.DownloadPath);
             if (parameter.OverWritable) {
                 Downloader loader = new Downloader();
                 loader.Download(parameter.DownloadPath, savePath);
             } else {
                 if (!File.Exists(savePath)) {
                     Downloader loader = new Downloader();
                     loader.Download(parameter.DownloadPath, savePath);
                 }
             }
         } catch (Exception e) {
             Trace.WriteLine(e);
         }
     });
 }
예제 #2
0
파일: Program.cs 프로젝트: ouaiea/miseruge1
        static string[] GetResourceList(string homeDirectory)
        {
            //ライブラリ EXEファイルのダウンロード
            Downloader loader = new Downloader();
            string url = "";
            if (Environment.Is64BitOperatingSystem) {
                url = @"http://www25333ue.sakura.ne.jp/tools/miseruge/filelist_x64.txt";
            } else {
                url = @"http://www25333ue.sakura.ne.jp/tools/miseruge/filelist_x86.txt";
            }
            string savePath = Path.Combine(homeDirectory, "filelist.txt");
            loader.Download(url, savePath);

            return File.ReadAllLines(savePath);
        }