示例#1
0
 void game_Exception(downloader sender, Exception e)
 {
     MessageBox.Show("下载失败,请重试或尝试手动下载" + game.Url + "\n" + e.Message, "错误");
     if (MessageBox.Show("是否尝试手动下载?", "手动下载", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         Process manual = new Process();
         manual.StartInfo.FileName = gamefile;
         manual.Start();
         MessageBox.Show("下载完成后点击确定");
         MessageBox.Show("将文件重命名为2dmmc.dat后放在启动器目录下点击确定");
         while (!File.Exists("2dmmc.dat"))
         {
             if (File.Exists("2dmmc.7z"))
             {
                 File.Move("2dmmc.7z", "2dmmc.dat");
                 Application.Restart();
             }
             if (!(MessageBox.Show("没找到2dmmc.dat", "没找到文件", MessageBoxButtons.RetryCancel) == DialogResult.Retry))
             {
                 break;
             }
         }
         if (File.Exists("2dmmc.dat"))
         {
             Application.Restart();
         }
     }
     Environment.Exit(0);
 }
示例#2
0
        void game_Finished(downloader sender)
        {
            WebClient d7z = new WebClient();

            d7z.DownloadFile("http://image.bangbang93.com/7za.exe", "unpakcer.exe");

            if (File.Exists("2dmmc4th.7z"))
            {
                File.Move("2dmmc4th.7z", "2dmmc.dat");
            }
            if (File.Exists("2dmmc.dat") == true)
            {
                Process un7z = new Process();
                un7z.StartInfo.FileName  = "unpakcer.exe";
                un7z.StartInfo.Arguments = "x -y 2dmmc.dat";
                //un7z.Exited += new EventHandler(un7z_Exited);
                un7z.Start();
                un7z.WaitForExit();
                File.Delete("unpakcer.exe");
                this.Close();
            }
            else
            {
                MessageBox.Show("找不到下载的文件");
                Environment.Exit(2);
            }
        }
示例#3
0
 void game_Speed(downloader sender)
 {
     speed.Text = sender.SpeedStr;
 }
示例#4
0
 void game_Progress(downloader sender)
 {
     progressBar1.Value = sender.FinishedRate;
     prog.Text = sender.FinishedRate.ToString()+"%";
 }
示例#5
0
        void game_Finished(downloader sender)
        {
            WebClient d7z = new WebClient();
            d7z.DownloadFile("http://image.bangbang93.com/7za.exe", "unpakcer.exe");

            if (File.Exists("2dmmc4th.7z"))
            {
                File.Move("2dmmc4th.7z", "2dmmc.dat");
            }
            if (File.Exists("2dmmc.dat") == true)
            {
                Process un7z = new Process();
                un7z.StartInfo.FileName = "unpakcer.exe";
                un7z.StartInfo.Arguments = "x -y 2dmmc.dat";
                //un7z.Exited += new EventHandler(un7z_Exited);
                un7z.Start();
                un7z.WaitForExit();
                File.Delete("unpakcer.exe");
                this.Close();
             }
                else
                {
                    MessageBox.Show("找不到下载的文件");
                    Environment.Exit(2);
                 }
        }
示例#6
0
 void game_Exception(downloader sender, Exception e)
 {
     MessageBox.Show("下载失败,请重试或尝试手动下载"+game.Url+"\n"+e.Message ,"错误");
     if (MessageBox.Show("是否尝试手动下载?", "手动下载", MessageBoxButtons.OKCancel) == DialogResult.OK)
     {
         Process manual = new Process();
         manual.StartInfo.FileName = gamefile;
         manual.Start();
         MessageBox.Show("下载完成后点击确定");
         MessageBox.Show("将文件重命名为2dmmc.dat后放在启动器目录下点击确定");
         while (!File.Exists("2dmmc.dat"))
         {
             if (File.Exists("2dmmc.7z"))
             {
                 File.Move("2dmmc.7z", "2dmmc.dat");
                 Application.Restart();
             }
             if (!(MessageBox.Show("没找到2dmmc.dat", "没找到文件", MessageBoxButtons.RetryCancel) == DialogResult.Retry))
             {
                 break;
             }
         }
         if (File.Exists("2dmmc.dat"))
         {
             Application.Restart();
         }
     }
     Environment.Exit(0);
 }
示例#7
0
 void game_Connected(downloader sender, string filename, string contentType)
 {
     size.Text = ((double)game.ContentLength/1024.0/1024.0).ToString("f")+"MB";
 }
示例#8
0
 void game_Speed(downloader sender)
 {
     speed.Text = sender.SpeedStr;
     //throw new NotImplementedException();
 }
示例#9
0
 void game_Progress(downloader sender)
 {
     progressBar1.Value = sender.FinishedRate;
     prog.Text = sender.FinishedRate.ToString()+"%";
     //speed.Text = sender.SpeedStr;
     //throw new NotImplementedException();
 }
示例#10
0
 void game_Finished(downloader sender)
 {
     WebClient cmd5 = new WebClient();
     if (cmd5.DownloadString("http://2dmmc.bangbang93.com/cmd5.txt").Substring(0,32)!=GetMD5HashFromFile("2dmmc.dat").ToUpper())
     {
         MessageBox.Show("下载错误,请重试\n" + cmd5.DownloadString("http://2dmmc.bangbang93.com/cmd5.txt") + "\n" + GetMD5HashFromFile("2dmmc.dat").ToUpper());
         Environment.Exit(0);
     }
     WebClient d7z=new WebClient();
     d7z.DownloadFile("http://image.bangbang93.com/7za.exe", "unpakcer.exe");
     if (File.Exists("2dmmc.dat") == true)
     {
         Process un7z = new Process();
         un7z.StartInfo.FileName = "unpakcer.exe";
         un7z.StartInfo.Arguments = "x -y 2dmmc.dat";
         //un7z.Exited += new EventHandler(un7z_Exited);
         un7z.Start();
         un7z.WaitForExit();
         File.Delete("unpakcer.exe");
         this.Close();
      }
         else
         {
             MessageBox.Show("找不到下载的文件");
             Environment.Exit(0);
          }
     stat = "finish";
 }
示例#11
0
 void game_Exception(downloader sender, Exception e)
 {
     MessageBox.Show("下载失败,请重试"+game.Url+"\n"+e.Message );
     Environment.Exit(0);
     throw new NotImplementedException();
 }
示例#12
0
 void game_Connected(downloader sender, string filename, string contentType)
 {
     size.Text = ((double)game.ContentLength/1024.0/1024.0).ToString("f")+"MB";
     //throw new NotImplementedException();
 }
示例#13
0
 void game_Connected(downloader sender, string filename, string contentType)
 {
     size.Text = ((double)game.ContentLength / 1024.0 / 1024.0).ToString("f") + "MB";
 }
示例#14
0
 void game_Progress(downloader sender)
 {
     progressBar1.Value = sender.FinishedRate;
     prog.Text          = sender.FinishedRate.ToString() + "%";
 }
示例#15
0
 void game_Speed(downloader sender)
 {
     speed.Text = sender.SpeedStr;
 }