出于某种原因,ArgumentException 说“参数无效”。at Application.Run 在执行以下任一操作时被抛出:
private void utilsTabBtn_Click(object sender, EventArgs e)
{
utilitiesPanel.BringToFront();
}
或这个:
private void utilsTabBtn_Click(object sender, EventArgs e)
{
utilitiesPanel.Visible = true;
accountcreatorPanel.Visible = false;
aboutPanel.Visible = false;
}
在此代码中执行 RequestCaptcha 后:
private void accountcreatorStartBtn_Click(object sender, EventArgs e)
{
accountcreatorStopBtn.Enabled = true;
accountcreatorStartBtn.Enabled = false;
recaptchaSolveBox.Enabled = true;
recaptchaContinueBtn.Enabled = true;
recaptchaRenewBtn.Enabled = true;
MinimalID = accIndexOne.Value;
CurrentID = MinimalID - 1;
MaximalID = accIndexTwo.Value;
RequestCaptcha();
recaptchaBox.SizeMode = PictureBoxSizeMode.StretchImage;
}
其中 RequestCaptcha 是:
private void RequestCaptcha()
{
LatestKey = ((new Random()).Next() * (new Random()).Next());
statusLbl.Text = "Captcha key: " + LatestKey.ToString();
recaptchaBox.Image.Dispose();
using (WebClient w = new WebClient())
{
w.DownloadFile(string.Format(RequestURL, LatestKey), Environment.CurrentDirectory + "/latestCaptcha.jpg");
}
try
{
recaptchaBox.Image = Image.FromFile(Environment.CurrentDirectory + "/latestCaptcha.jpg");
}
catch (Exception ex)
{
recaptchaBox.Image = recaptchaBox.ErrorImage;
MessageBox.Show(ex.Message, this.Text + " - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
除了以“TabBtn”结尾的按钮和面板外,所有控件都在我要隐藏的面板中。