コード例 #1
0
        private void HandleGSResponse(GSResponse res, string format)
        {
            lblVerifiedSig.Text = "";
            if (!format.Equals("xml", StringComparison.InvariantCultureIgnoreCase))
            {
                format = "txt";
            }

            var filename = Path.Combine(Path.GetTempPath(), "1." + format);

            try {
                if (res.GetErrorCode() > 0)
                {
                    lblVerifiedSig.ForeColor = Color.Red;
                    lblVerifiedSig.Text      = "Error !!!";
                    File.WriteAllText(filename, res.ToString());
                }
                else
                {
                    if (verifySignature)
                    {
                        verifyResponseSignature(res, format);
                    }
                    else
                    {
                        lblVerifiedSig.Text = "Data is ready";
                    }
                    File.WriteAllText(filename, res.GetResponseText());
                }
                webBrowser1.Navigate(filename);
                webBrowser1.Show();
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            btnSubmit.Text    = "Submit";
            btnSubmit.Enabled = true;
        }