当前位置: 首页>>代码示例>>C#>>正文


C# WebBrowser.Navigate方法代码示例

本文整理汇总了C#中System.Windows.Controls.WebBrowser.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.Navigate方法的具体用法?C# WebBrowser.Navigate怎么用?C# WebBrowser.Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.WebBrowser的用法示例。


在下文中一共展示了WebBrowser.Navigate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: autorize

 public static void  autorize(WebBrowser _webBrowser)
 {
     string clientID = "4273691";
     string url = string.Format("http://oauth.vk.com/authorize?client_id={0}&scope=friends,audio&redirect_uri=https://oauth.vk.com/blank.html&display=popup&response_type=token", clientID);
     _webBrowser.Navigated += _webBrowser_Navigated;
     _webBrowser.Navigate(url);
 }
开发者ID:fargutvest,项目名称:TriedStartUp,代码行数:7,代码来源:autorizeVK.cs

示例2: RunTabItem

        public RunTabItem (string header)
        {
            FrameName = "";
            this.Header = header; 
            WebBrowser = new WebBrowser();
            WebBrowser.ObjectForScripting = new ScriptHelper(WebBrowser); 
            this.Content = WebBrowser ;
            this.Style = Application.Current.MainWindow.FindResource("MainTabItemStyle") as Style;
            WebBrowser.Navigate("about:blank");
            
            
            var SID_SWebBrowserApp = new Guid("0002DF05-0000-0000-C000-000000000046");
            var serviceProvider = (IServiceProvider)WebBrowser.Document;

            var serviceGuid = SID_SWebBrowserApp;

            var iid = typeof(SHDocVw.IWebBrowser2).GUID;
            ////Here we will get a reference to the IWebBrowser2 interface
              ExBrowser = (SHDocVw.IWebBrowser2)serviceProvider.QueryService(ref serviceGuid, ref iid);
            ////To hook events we just need to do these casts
                Events2 = (SHDocVw.DWebBrowserEvents_Event)ExBrowser;
              Events = (SHDocVw.DWebBrowserEvents2_Event)ExBrowser;
              System.Runtime.InteropServices.Marshal.ReleaseComObject((object)serviceProvider);
            


        }
开发者ID:powerhai,项目名称:Jinchen,代码行数:27,代码来源:RunTabItem.cs

示例3: PhoneApplicationPage_Loaded

        /// <summary>
        /// Page_Loaded event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            
            WebBrowser webBrowser = new WebBrowser();
           

            RowDefinition rdWebBrowser=new RowDefinition();
            RowDefinition rdProgressBar = new RowDefinition();

            rdProgressBar.Height = new GridLength(0.3, GridUnitType.Star);
            rdWebBrowser.Height = new GridLength(13, GridUnitType.Star);
            pgBar.Height = 10;
            pgBar.IsIndeterminate = true;
            pgBar.Visibility = Visibility.Visible;
            webBrowser.Navigate(new Uri(RxConstants.myLocalPharmacySupport, UriKind.Absolute));

            webBrowser.Navigated += new EventHandler<NavigationEventArgs>(NavigateHandler);
            webBrowser.Visibility = Visibility.Visible;
            webBrowser.Margin.Top.Equals(-12);
            webBrowser.IsScriptEnabled = true;
            
            ContentPanel.RowDefinitions.Insert(0, rdProgressBar);
            ContentPanel.RowDefinitions.Insert(1, rdWebBrowser);

            Grid.SetRow(pgBar, 0);
            Grid.SetRow(webBrowser, 1);

            ContentPanel.Children.Add(pgBar);
            ContentPanel.Children.Add(webBrowser);
           
        }
开发者ID:EdytaSzkiladz,项目名称:MyLocalPharmacy,代码行数:36,代码来源:SupportPage.xaml.cs

示例4: LoginAsync

        private Task<LiveConnectSession> LoginAsync()
        {
            TaskCompletionSource<LiveConnectSession> taskCompletion = new TaskCompletionSource<LiveConnectSession>();

            var url = _client.GetLoginUrl(new[] { "wl.basic", "wl.signin", "onedrive.readonly", "wl.skydrive", "wl.photos" });

            WebBrowser browser = new WebBrowser();
            var window = new Window();
            window.Content = browser;

            NavigatingCancelEventHandler handler = null;
            handler = async (o, args) =>
            {
                if (args.Uri.AbsolutePath.Equals("/oauth20_desktop.srf"))
                {
                    browser.Navigating -= handler;
                    window.Close();

                    var session = await GetConnectSession(args.Uri.Query);
                    taskCompletion.SetResult(session);
                }
            };
            browser.Navigating += handler;
            browser.Navigate(url);
            window.Show();
            return taskCompletion.Task;
        }
开发者ID:skendrot,项目名称:CloudBackup,代码行数:27,代码来源:Authenticator.cs

示例5: WebViewBackend

 internal WebViewBackend(SWC.WebBrowser browser)
 {
     view = browser;
     view.Navigating += HandleNavigating;
     view.Navigated += HandleNavigated;
     view.LoadCompleted += HandleLoadCompleted;
     view.Loaded += HandleViewLoaded;
     Widget = view;
     view.Navigate ("about:blank"); // force Document initialization
     Title = string.Empty;
 }
开发者ID:akrisiun,项目名称:xwt,代码行数:11,代码来源:WebViewBackend.cs

示例6: User

        public User()
        {
            LogView = new WebBrowser();
            LogView.Navigate(new Uri(AppResources.Server + "League.aspx"));
            //LogView.Navigate(new Uri("/League.html", UriKind.Relative));
            int loadbrowser = 0;
            while (LogView.SaveToString().Length < 1) { loadbrowser++; }
            string x = LogView.SaveToString();
            MessageBox.Show("Done");

            InitializeComponent();
        }
开发者ID:davidsamuel1610,项目名称:DDT,代码行数:12,代码来源:User.xaml.cs

示例7: PostToWall

        //AAAIOfwttlbABADAgOfra14zhgQi2V82yNfuscJjLIwX0rT9nqRg4YYbmxZAZByKwq0lYWVvn9f1fIfEbY3i1wmQx2tZAOtpRxqGEDlE2phqiltqLw3X
        //access token for me
        public static void PostToWall(string message, long userId, string wallAccessToken, WebBrowser fBrowser)
        {
            var fb = new FacebookClient(wallAccessToken);
            string url = string.Format("{0}/{1}", userId, "feed");
            var argList = new Dictionary<string, object>();
            argList["message"] = message;
            fb.Post(url, argList);

            var fb2 = new FacebookClient();
            var logoutUrl = fb.GetLogoutUrl(new { access_token = wallAccessToken, next = "https://www.facebook.com/connect/login_success.html" });
            fBrowser.Navigate(logoutUrl);
        }
开发者ID:cbacon91,项目名称:Blacklist,代码行数:14,代码来源:FacebookManager.cs

示例8: WebContent

    public WebContent(RegionOptions options)
    : base(options.Width, options.Height, options.Top, options.Left)
    {
        duration        = options.Duration;
        scheduleId      = options.scheduleId;
        layoutId        = options.layoutId;
        mediaId         = options.mediaid;
        type = options.FileType;

        webBrowser = new WebBrowser();

        webBrowser.Height = options.Height;
        webBrowser.Width = options.Width;

        //webBrowser.ScrollBarsEnabled = false;
        //webBrowser.ScriptErrorsSuppressed = true;

        // Attach event
        webBrowser.LoadCompleted +=  (WebBrowserDocumentCompleted);

        if (!Settings.Default.powerpointEnabled && options.FileType == "powerpoint")
        {
            webBrowser.Source = new Uri("<html><body><h1>Powerpoint not enabled on this display</h1></body></html>");
            System.Diagnostics.Trace.WriteLine(String.Format("[*]ScheduleID:{1},LayoutID:{2},MediaID:{3},Message:{0}", "Powerpoint is not enabled on this display", scheduleId, layoutId, mediaId));
        }
        else
        {
            try
            {
                // Try to make a URI out of the file path
                try
                {
                    this.filePath = Uri.UnescapeDataString(options.Uri);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.Message, "WebContent");
                }

                // Navigate
                webBrowser.Navigate(this.filePath);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(String.Format("[*]ScheduleID:{1},LayoutID:{2},MediaID:{3},Message:{0}", ex.Message, scheduleId, layoutId, mediaId));

                webBrowser.Source = new Uri("<html><body><h1>Unable to show this web location - invalid address.</h1></body></html>");

                System.Diagnostics.Trace.WriteLine(String.Format("[*]ScheduleID:{1},LayoutID:{2},MediaID:{3},Message:{0}", "Unable to show the powerpoint, cannot be located", scheduleId, layoutId, mediaId));
            }
        }
    }
开发者ID:afrog33k,项目名称:eAd,代码行数:52,代码来源:WebContent.cs

示例9: Map

 public Map() {
     /*var map = new StaticMap();
     map.Center = "1000 7h Ave"; // or a lat/lng coordinate
     map.Zoom = "14";
     map.Size = "400x400";
     map.Sensor = "true";
     var uriMap = map.ToUri();
     */
     Uri uriMap = new Uri("http://maps.google.com/");
     wb = new WebBrowser();
     Children.Add(wb);
     wb.Navigate(uriMap);
 }
开发者ID:misak113,项目名称:myAccount.NET,代码行数:13,代码来源:Map.cs

示例10: LinkAsync

 /// <summary>
 /// Links a <see cref="ParseUser" /> to a Facebook account, allowing you to use Facebook
 /// for authentication, and providing access to Facebook data for the user.
 /// 
 /// The user will be logged in through Facebook's OAuth web flow, so you must supply a
 /// <paramref name="webView"/> that will be navigated to Facebook's authentication pages.
 /// </summary>
 /// <param name="user">The user to link with Facebook.</param>
 /// <param name="webView">A web view that will be used to present the authorization pages
 /// to the user.</param>
 /// <param name="permissions">A list of Facebook permissions to request.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 public static async Task LinkAsync(ParseUser user,
     WebBrowser webView,
     IEnumerable<string> permissions,
     CancellationToken cancellationToken) {
   authProvider.Permissions = permissions;
   LoadCompletedEventHandler loadCompleted = (_, e) => authProvider.HandleNavigation(e.Uri);
   webView.LoadCompleted += loadCompleted;
   Action<Uri> navigate = uri => webView.Navigate(uri);
   authProvider.Navigate += navigate;
   await user.LinkWithAsync("facebook", cancellationToken);
   authProvider.Navigate -= navigate;
   webView.LoadCompleted -= loadCompleted;
 }
开发者ID:cnbcyln,项目名称:Parse-SDK-dotNET,代码行数:25,代码来源:ParseFacebookUtils.NetFx45.cs

示例11: LogInAsync

 /// <summary>
 /// Logs in a <see cref="ParseUser" /> using Facebook for authentication. If a user for the
 /// given Facebook credentials does not already exist, a new user will be created.
 /// 
 /// The user will be logged in through Facebook's OAuth web flow, so you must supply a
 /// <paramref name="webView"/> that will be navigated to Facebook's authentication pages.
 /// </summary>
 /// <param name="webView">A web view that will be used to present the authorization pages
 /// to the user.</param>
 /// <param name="permissions">A list of Facebook permissions to request.</param>
 /// <param name="cancellationToken">The cancellation token.</param>
 /// <returns>The user that was either logged in or created.</returns>
 public static async Task<ParseUser> LogInAsync(WebBrowser webView,
     IEnumerable<string> permissions,
     CancellationToken cancellationToken) {
   authProvider.Permissions = permissions;
   LoadCompletedEventHandler loadCompleted = (_, e) => authProvider.HandleNavigation(e.Uri);
   webView.LoadCompleted += loadCompleted;
   Action<Uri> navigate = uri => webView.Navigate(uri);
   authProvider.Navigate += navigate;
   var result = await ParseUser.LogInWithAsync("facebook", cancellationToken);
   authProvider.Navigate -= navigate;
   webView.LoadCompleted -= loadCompleted;
   return result;
 }
开发者ID:cnbcyln,项目名称:Parse-SDK-dotNET,代码行数:25,代码来源:ParseFacebookUtils.NetFx45.cs

示例12: Show

        public void Show(string account, Uri authenticationUri, Uri redirectUri)
        {
            if (window == null) {
                waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
                var uiThread = new Thread(() => {
                    window = new Window() { Title = account };
                    window.Closing += (s, e) => {
                        window.Hide();
                        waitHandle.Set();
                        e.Cancel = true;
                    };

                    browser = new WebBrowser();
                    browser.Loaded += (s, e) => {
                        browser.Navigate(authenticationUri);
                    };
                    browser.Navigating += (s, e) => {
                        if (redirectUri.IsBaseOf(e.Uri) && redirectUri.AbsolutePath == e.Uri.AbsolutePath) {
                            var parameters = new NameValueCollection();
                            foreach (var parameter in e.Uri.Query.TrimStart('?').Split('&')) {
                                var nameValue = parameter.Split('=');
                                parameters.Add(nameValue[0], nameValue[1]);
                            }
                            var handler = Authenticated;
                            handler?.Invoke(this, new AuthenticatedEventArgs(parameters));
                            e.Cancel = true;
                        }
                    };
                    browser.Navigated += (s, e) => {
                        if (authenticationUri.IsBaseOf(e.Uri))
                            SetForegroundWindow(new WindowInteropHelper(window).Handle);
                    };

                    window.Content = browser;
                    window.Show();

                    System.Windows.Threading.Dispatcher.Run();
                });
                uiThread.SetApartmentState(ApartmentState.STA);
                uiThread.Start();
            } else {
                window.Dispatcher.Invoke(() => {
                    browser.Source = authenticationUri;
                    window.Title = account;
                    window.Show();
                });
            }

            waitHandle.WaitOne();
        }
开发者ID:viciousviper,项目名称:PowerShellCloudProvider,代码行数:50,代码来源:BrowserWindow.cs

示例13: LoadWebBrowser

 public void LoadWebBrowser(WebBrowser browser)
 {
     var authorizer = new OAuthAuthorizer(AppBootstrapper.ConsumerKey, AppBootstrapper.ConsumerSecret);
     authorizer.GetRequestToken("https://api.twitter.com/oauth/request_token")
         .Select(x => x.Token)
         .DispatcherSubscribe(
             token =>
             {
                 _token = token;
                 string url = authorizer.BuildAuthorizeUrl("https://api.twitter.com/oauth/authorize", token);
                 browser.Navigate(new Uri(url));
             },
             OnError);
 }
开发者ID:bling,项目名称:Ping.Pong,代码行数:14,代码来源:AuthorizationViewModel.cs

示例14: GoalB_Click

 private void GoalB_Click(object sender, RoutedEventArgs e)
 {
     WebBrowser browser1 = new WebBrowser();
     browser1.Navigate(new Uri(AppResources.Server + "Goal.aspx?teamScoring=" + "B" + "&MatchId=" + AppResources.GameId));
     int loadbrowser = 0;
     while (browser1.SaveToString().Length < 1) { loadbrowser++; }
     string Data = browser1.SaveToString();
     string[] RawHtmlSplit = Data.Split('`');
     string DataNeeded = RawHtmlSplit[1];
     if (DataNeeded.Contains("Score Updated"))
     {
         scoreB++;
         ScoreB.Text = String.Format("{0}", scoreB);
     }
     else MessageBox.Show("Action Failed");
 }
开发者ID:davidsamuel1610,项目名称:DDT,代码行数:16,代码来源:Ref.xaml.cs

示例15: GetElement

        public override FrameworkElement GetElement(string fileName)
        {
            var maxWidth = SystemParameters.WorkArea.Width - 100;
            var maxHeight = SystemParameters.WorkArea.Height - 100;

            var webBrowser = new WebBrowser();

            webBrowser.BeginInit();
            webBrowser.Width = maxWidth / 2;
            webBrowser.Height = maxHeight / 2;
            webBrowser.EndInit();

            webBrowser.Navigate(new Uri(fileName, UriKind.Absolute));

            return webBrowser;
        }
开发者ID:shibayan,项目名称:WinQuickLook,代码行数:16,代码来源:HtmlPreviewHandler.cs


注:本文中的System.Windows.Controls.WebBrowser.Navigate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。