예제 #1
0
 public Set(ice f)
 {
     Plugin = f;
     InitializeComponent();
     this.Icon = Static.icon;
     this.Text = "小冰助手";
 }
예제 #2
0
        public GetTk(ice f, string url)
        {
            Plugin             = f;
            SetCookie.Plugin   = f;
            SetCookie.tkPlugin = this;
            InitializeComponent();
            this.Icon = QQRobotFramework.Static.icon;
            panel1.Controls.Clear();

            CefSettings settings = new CefSettings();

            settings.Locale = "zh-CN";
            settings.CefCommandLineArgs.Add("disable-gpu", "1");
            try
            {
                Cef.Initialize(settings);
            }
            catch
            {
            }
            if (File.Exists(QQRobotFramework.Robot.path + @"PluginBingIce\cookie.txt"))
            {
                string cookie = File.ReadAllText(QQRobotFramework.Robot.path + @"PluginBingIce\cookie.txt");
                SetCookie.cookies = QQRobotFramework.JsonHelper.DeserializeObject <CookieData[]>(cookie).ToList <CookieData>();
            }


            wb = new ChromiumWebBrowser(url);

            BrowserSettings browserSettings = new BrowserSettings();

            browserSettings.FileAccessFromFileUrls      = CefState.Enabled;
            browserSettings.UniversalAccessFromFileUrls = CefState.Enabled;
            wb.BrowserSettings = browserSettings;

            wb.RequestHandler = new WinFormsRequestHandler();
            panel1.Controls.Add(wb);

            wb.Dock = DockStyle.Fill;
        }