Exemplo n.º 1
0
    public void WeGOTit()
    {
        if (CancelDownload == true)
        {
            return;
        }
        string DownloadedIPSWFileName = IPSWurl.Substring(IPSWurl.LastIndexOf('/') + 1);

        //Wait for File to stop being written...
        while (!(FileInUse(temppath + "\\" + DownloadedIPSWFileName) == false))
        {
            Delay(0.5);
        }
        //
        //md5 the bitch!
        progresstxt.Visible  = false;
        ProgressBar1.Visible = false;

        dl4mebtn.Visible = false;
        ORlabel.Visible  = false;
        Button3.Visible  = false;
        spinny.Visible   = true;
        verify.Text      = "Verifying IPSW...";
        verify.Left      = 15;
        verify.Visible   = true;
        ipsw             = temppath + "\\" + DownloadedIPSWFileName;
        get_MD5          = new System.ComponentModel.BackgroundWorker();
        get_MD5.WorkerReportsProgress      = true;
        get_MD5.WorkerSupportsCancellation = true;
        get_MD5.RunWorkerAsync();
        int i = 0;

        while (!(i == 1))
        {
            if (string.IsNullOrEmpty(ipswhash))
            {
                //Continue
            }
            else
            {
                return;
            }
            if (verify.Text.Length == 109)
            {
                verify.Text = "Verifying IPSW.";
            }
            verify.Text = verify.Text + ".";
            Delay(0.01);
        }
        return;
    }
Exemplo n.º 2
0
    private void Worker_DoWork(System.Object sender, System.ComponentModel.DoWorkEventArgs e)
    {
        var    _with2  = h;
        object Request = _with2.GetFile(IPSWurl, string.Empty, temppath + "\\" + IPSWurl.Substring(IPSWurl.LastIndexOf('/') + 1));

        if (Request == null)
        {
            // Downloading
        }
        else
        {
            switch (Request.GetType().ToString())
            {
            case "System.Net.HttpWebResponse":
                break;

            default:
                switch (Request.GetType().ToString())
                {
                case "System.Net.WebException":
                    Debug.Print(((System.Net.WebException)Request).Message);
                    break;

                case "System.Exception":
                    Debug.Print(((System.Exception)Request).Message);
                    break;

                default:
                    Debug.Print("Else: " + Request.GetType().ToString());
                    break;
                }
                return;

                break;
            }
        }
    }