如何从源C#单击按钮

问题描述

嗨,大家好,这是当用户打开exe时会弹出一个接受条款表单源代码,并要求单击接受按钮; 我该如何获取接受点击表单源,例如当exe打开时没有接受窗口弹出,因为它已经被接受了?

using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Honeygain.Presenters;
using Honeygain.Views.Controls;
using Honeygain.Views.Events;

namespace Honeygain.Views.Forms
{
    // Token: 0x02000011 RID: 17
    internal class TermsForm : BaseForm
    {
        // Token: 0x1400001F RID: 31
        // (add) Token: 0x060000EB RID: 235 RVA: 0x00007DE0 File Offset: 0x00005FE0
        // (remove) Token: 0x060000EC RID: 236 RVA: 0x00007E18 File Offset: 0x00006018
        public event EventHandler<FormFailedEventArgs> TermsFailed;

        // Token: 0x14000020 RID: 32
        // (add) Token: 0x060000ED RID: 237 RVA: 0x00007E50 File Offset: 0x00006050
        // (remove) Token: 0x060000EE RID: 238 RVA: 0x00007E88 File Offset: 0x00006088
        public event EventHandler TermsRejected;

        // Token: 0x060000EF RID: 239 RVA: 0x00002A43 File Offset: 0x00000C43
        public TermsForm(IMainPresenter presenter)
        {
            this.InitializeComponent();
            this._presenter = presenter;
        }

        // Token: 0x060000F0 RID: 240 RVA: 0x00002A58 File Offset: 0x00000C58
        public void CloseTerms()
        {
            CancellationTokenSource actionCTS = this._actionCTS;
            if (actionCTS != null)
            {
                actionCTS.Cancel();
            }
            this._actionCTS = null;
            this._vid = null;
            base.Hide();
        }

        // Token: 0x060000F1 RID: 241 RVA: 0x00007EC0 File Offset: 0x000060C0
        public void ShowTerms(string text,string version,string vid)
        {
            if (!base.Visible)
            {
                CancellationTokenSource actionCTS = this._actionCTS;
                if (actionCTS != null)
                {
                    actionCTS.Cancel();
                }
                this._actionCTS = new CancellationTokenSource();
                this.body.DocumentText = text;
                this._version = version;
                this._vid = vid;
                base.ShowCenter();
            }
        }

        // Token: 0x060000F2 RID: 242 RVA: 0x00002A7F File Offset: 0x00000C7F
        private void OnFormVisibleChanged(object sender,EventArgs e)
        {
            if (!base.Visible)
            {
                this.Reject();
            }
        }

        // Token: 0x060000F3 RID: 243 RVA: 0x00007F14 File Offset: 0x00006114
        private void OnAcceptClick(object sender,EventArgs e)
        {
            TermsForm.<OnAcceptClick>d__14 <OnAcceptClick>d__;
            <OnAcceptClick>d__.<>4__this = this;
            <OnAcceptClick>d__.<>t__builder = AsyncVoidMethodBuilder.Create();
            <OnAcceptClick>d__.<>1__state = -1;
            <OnAcceptClick>d__.<>t__builder.Start<TermsForm.<OnAcceptClick>d__14>(ref <OnAcceptClick>d__);
        }

        // Token: 0x060000F4 RID: 244 RVA: 0x00002A8F File Offset: 0x00000C8F
        private void Reject()
        {
            if (!string.IsNullOrEmpty(this._vid))
            {
                EventHandler termsRejected = this.TermsRejected;
                if (termsRejected != null)
                {
                    termsRejected(this,EventArgs.Empty);
                }
            }
            this.CloseTerms();
        }

        // Token: 0x060000F5 RID: 245 RVA: 0x00007F4C File Offset: 0x0000614C
        private Task Accept()
        {
            TermsForm.<Accept>d__16 <Accept>d__;
            <Accept>d__.<>4__this = this;
            <Accept>d__.<>t__builder = AsyncTaskMethodBuilder.Create();
            <Accept>d__.<>1__state = -1;
            <Accept>d__.<>t__builder.Start<TermsForm.<Accept>d__16>(ref <Accept>d__);
            return <Accept>d__.<>t__builder.Task;
        }

        // Token: 0x060000F6 RID: 246 RVA: 0x00002ABB File Offset: 0x00000CBB
        private void Prepare()
        {
            base.Enabled = false;
        }

        // Token: 0x060000F7 RID: 247 RVA: 0x00002AC4 File Offset: 0x00000CC4
        private void Finish()
        {
            base.Enabled = true;
        }

        // Token: 0x060000F8 RID: 248 RVA: 0x00002ACD File Offset: 0x00000CCD
        private void Fail(Exception exception)
        {
            EventHandler<FormFailedEventArgs> termsFailed = this.TermsFailed;
            if (termsFailed != null)
            {
                termsFailed(this,new FormFailedEventArgs
                {
                    Error = exception
                });
            }
            this.CloseTerms();
        }

        // Token: 0x060000F9 RID: 249 RVA: 0x00002AF3 File Offset: 0x00000CF3
        protected override void dispose(bool disposing)
        {
            if (disposing && this.components != null)
            {
                this.components.dispose();
            }
            base.dispose(disposing);
        }

        // Token: 0x060000FA RID: 250 RVA: 0x00007F90 File Offset: 0x00006190
        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(TermsForm));
            this.panel = new TableLayoutPanel();
            this.body = new Termsbrowser(this.components);
            this.accept = new Button();
            this.title = new Label();
            this.panel.SuspendLayout();
            base.SuspendLayout();
            componentResourceManager.ApplyResources(this.panel,"panel");
            this.panel.Controls.Add(this.body,1);
            this.panel.Controls.Add(this.accept,2);
            this.panel.Controls.Add(this.title,0);
            this.panel.Name = "panel";
            componentResourceManager.ApplyResources(this.body,"body");
            this.body.IsWebbrowserContextMenuEnabled = false;
            this.body.Name = "body";
            this.body.ScriptErroRSSuppressed = true;
            this.body.WebbrowserShortcutsEnabled = false;
            componentResourceManager.ApplyResources(this.accept,"accept");
            this.accept.BackColor = Color.FromArgb(11,152,222);
            this.accept.ForeColor = Color.White;
            this.accept.Name = "accept";
            this.accept.UseVisualStyleBackColor = false;
            this.accept.Click += this.OnAcceptClick;
            componentResourceManager.ApplyResources(this.title,"title");
            this.title.ForeColor = Color.FromArgb(14,65,88);
            this.title.Name = "title";
            componentResourceManager.ApplyResources(this,"$this");
            base.Controls.Add(this.panel);
            base.Name = "TermsForm";
            base.VisibleChanged += this.OnFormVisibleChanged;
            this.panel.ResumeLayout(false);
            this.panel.Performlayout();
            base.ResumeLayout(false);
            base.Performlayout();
        }

        // Token: 0x0400006D RID: 109
        private readonly IMainPresenter _presenter;

        // Token: 0x0400006E RID: 110
        private string _version;

        // Token: 0x0400006F RID: 111
        private string _vid;

        // Token: 0x04000070 RID: 112
        private CancellationTokenSource _actionCTS;

        // Token: 0x04000073 RID: 115
        private IContainer components;

        // Token: 0x04000074 RID: 116
        private TableLayoutPanel panel;

        // Token: 0x04000075 RID: 117
        private Termsbrowser body;

        // Token: 0x04000076 RID: 118
        private Button accept;

        // Token: 0x04000077 RID: 119
        private Label title;
    }
}

嗨,大家好,这是当用户打开exe时会弹出一个接受条款表单源代码,并要求单击接受按钮; 我该如何获取接受点击表单源,例如当exe打开时没有接受窗口弹出,因为它已经被接受了?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...