暇つぶしにライセンス認証を作っておりますが、
初回の(MessageBox.Show)ではpremiumStateのデータが取得できていますが、ifのpremiumStateは反応なしです。
何が間違っているかご教授いただけませんでしょうか。
参考コードなど、コード編集などしていただけると幸いです。
WebClient fetchInfo = new WebClient(); string premiumState = fetchInfo.DownloadString("http://〇〇〇/validate.php?serial=" + textSerial.Text + "&hwid=" + textHwid.Text); MessageBox.Show(premiumState); if (premiumState == "ok") { Settings.Default.Serial = this.textSerial.Text; Settings.Default.Save(); base.DialogResult = DialogResult.OK; base.Close(); return; } if (premiumState == "ng1") { MessageBox.Show("有効期限が切れています。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.btnRegister.Enabled = true; return; } if (premiumState == "ng2") { MessageBox.Show("シリアルは他のPCで使用済みです。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.btnRegister.Enabled = true; return; } if (premiumState == "ng0") { MessageBox.Show("シリアルが正しくありません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.btnRegister.Enabled = true; return; } MessageBox.Show("エラーが発生しました。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Hand); this.btnRegister.Enabled = true;