Esempio n. 1
0
        public BrowserPage()
        {
            InitializeComponent();

            // Загрузить страница мода в Фейсбуке
            WBrowser.Navigate("https://m.facebook.com/HOI.Economic.Crisis");
        }
Esempio n. 2
0
        private void browserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //this.Hide();
            WBrowser browser = new WBrowser(this);

            browser.ShowDialog();
        }
        public FacebookAuthorization()
        {
            InitializeComponent();
            string OAuthURL = @"https://graph.facebook.com/oauth/authorize?client_id=428267497382622&redirect_uri=http://www.facebook.com/connect/login_success.html&scopes=publish_pages,user_videos,pages_manage_cta,manage_pages,user_posts,user_status,publish_actions,user_photos,friends_photos,public_profile,read_stream&type=user_agent&display=popup";

            WBrowser.Navigate(new Uri(OAuthURL, UriKind.Absolute));
        }
Esempio n. 4
0
        public SocialSiteLogin()
        {
            InitializeComponent();
            string AppID = "526993964420180";

            //WBrowser.Navigate(new Uri("https://graph.facebook.com/oauth/authorize?client_id=526993964420180&redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup", UriKind.Absolute));
            //const string AppId = "224928161551097";



            WBrowser.Navigate(new Uri("https://graph.facebook.com/v2.6/device/login?access_token=526993964420180&scope=public_profile&redirect_uri=http://www.facebook.com/connect/login_success.html", UriKind.Absolute));
        }
Esempio n. 5
0
        public FacebookOAuth()
        {
            InitializeComponent();

            DeleteFacebookCookie();

            var destinationURL = String.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri=https://www.facebook.com/connect/login_success.html&scope={1}&type=user_agent&display=popup",
                                               _AppID, //client_id
                                               _Scope  //scope
                                               );

            WBrowser.Navigate(new Uri(destinationURL).AbsoluteUri);
        }
Esempio n. 6
0
        private void UListView_ItemActivated(object sender, ItemActivatedEventArgs e)
        {
            if (e.Item?.Key == null)
            {
                return;
            }

            if (e.Item.Key.ToUpper().Contains(".PDF"))
            {
                WBrowser.Navigate(e.Item.Key);
            }
            else
            {
                wb.LoadDocument(e.Item.Key);
            }
        }
Esempio n. 7
0
        private void UBtnMove_Click(object sender, EventArgs e)
        {
            foreach (var x in uListView.Items)
            {
                if (x.CheckState != CheckState.Checked || x.SubItems["Okres"]?.Value == null)
                {
                    continue;
                }

                var dt = (DateTime)x.SubItems["Okres"].Value;
                dt = (DateTime)x.SubItems["Okres"].Value == new DateTime() ? DateTime.Now : dt;
                var month = dt.Month.ToString();
                month = month.Length == 1 ? "0" + month : month;
                var year          = dt.Year.ToString();
                var MonthYear     = month + "-" + year;
                var destDirectory = Path.Combine(Settings.Instance.DestPath, MonthYear);

                if (!Directory.Exists(destDirectory))
                {
                    Directory.CreateDirectory(destDirectory);
                }

                var symbol = (string)x.SubItems["Symbol"].Value;

                symbol = string.IsNullOrEmpty(symbol) ? "Faktura" : symbol;

                var nrFaktury = 1;


                var fileName = $"{Settings.Instance.FileNameDest} {symbol} {MonthYear}.pdf";
                if (symbol == "Faktura")
                {
                    fileName = $"{Settings.Instance.FileNameDest} {symbol}{nrFaktury} {MonthYear}.pdf";
                    nrFaktury++;
                }

                var notExists = false;
                while (!notExists)
                {
                    if (File.Exists(Path.Combine(destDirectory, fileName)))
                    {
                        fileName = $"{Settings.Instance.FileNameDest} {symbol}{nrFaktury} {MonthYear}.pdf";
                        nrFaktury++;
                    }
                    else
                    {
                        notExists = true;
                    }
                }

                WBrowser.Navigate("about:blank");
                while (WBrowser.ReadyState != WebBrowserReadyState.Complete)
                {
                    Application.DoEvents();
                    Thread.Sleep(100);
                }

                var pf = new PairFiles
                {
                    Old  = x.Key,
                    News = Path.Combine(destDirectory, fileName)
                };

                Logs.Log.FileOperation.Add(pf);
                File.Move(x.Key, Path.Combine(destDirectory, fileName));
            }

            Logs.Log.SerializeLog();
            Logs.Log.MyInstance         = null;
            MailSettings.Ins.MyInstance = null;
            RefreshExplorer();
        }