本文整理汇总了C#中System.Windows.Forms.WebBrowserNavigatedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# WebBrowserNavigatedEventArgs类的具体用法?C# WebBrowserNavigatedEventArgs怎么用?C# WebBrowserNavigatedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebBrowserNavigatedEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了WebBrowserNavigatedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
this.Left = 0;
this.Top = 0;
this.Width = this.ParentForm.Width;
this.Height = this.ParentForm.Height-50;
}
开发者ID:ShallYu,项目名称:mood_massage,代码行数:7,代码来源:qPaper.cs
示例2: browser_Navigated
private void browser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
//Console.WriteLine(e.Url);
var pattern = @"code=([\d|a-zA-Z]*)";
if (Regex.IsMatch(e.Url.Query, pattern))
{
panelMask.Visible = true;
panelMask.BringToFront();
var code = Regex.Match(e.Url.Query, pattern).Groups[1].Value;
Task.Factory.StartNew(() =>
{
OpenAuth.GetAccessTokenByCode(code);
UpdateUI(() =>
{
if (OpenAuth.IsAuthorized)
{
Code = code;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
}
else
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Close();
}
});
});
}
}
开发者ID:NetDimension,项目名称:WeiboSDK,代码行数:35,代码来源:AuthenticationForm.cs
示例3: LoginBrowser_Navigated
private void LoginBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (e.Url.ToString().Contains("#"))
{
Regex r = new Regex(@"\{(.*)\}");
string[] json = r.Match(e.Url.ToString()).Value.Replace("{", "").Replace("}", "").Replace("\"", "").Split(',');
Hashtable h = new Hashtable();
foreach (string str in json)
{
string[] kv = str.Split(':');
h[kv[0]] = kv[1];
}
this.si = new SessionInfo();
this.si.AppId = this.AppId;
this.si.Permissions = this.Permissions;
this.si.MemberId = (string)h["mid"];
this.si.SessionId = (string)h["sid"];
this.si.Expire = Convert.ToInt32(h["expire"]);
this.si.Secret = (string)h["secret"];
this.si.Signature = (string)h["sig"];
this.LoginInfoReceived = true;
this.Close();
}
}
开发者ID:ivukovi4,项目名称:RestMap,代码行数:26,代码来源:BrowserAuthorization.cs
示例4: browser_Navigated
private void browser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
lblLoading.Visible = false;
txtHtmlView.Text = browser.DocumentText;
IHTMLDocument2 doc2 = browser.Document.DomDocument as IHTMLDocument2;
// doc2.designMode = "On";
}
开发者ID:Nullstr1ng,项目名称:dotnet-regex-tools,代码行数:7,代码来源:BrowserInputForm.cs
示例5: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
string responsed = e.Url.ToString();
if (responsed.StartsWith("http://localhost/inverify"))
{
responsed = responsed.Replace("http://localhost/inverify?", "");
string[] args = responsed.Split('&');
foreach(string arg in args)
{
string[] values = arg.Split('=');
if(values[0] == "oauth_token")
oauth_token = values[1];
if(values[0] == "oauth_verifier")
oauth_verifier = values[1];
}
}
if (oauth_token != null && oauth_verifier != null)
{
if (AuthorizeCompleted != null)
{
AuthorizeCompleted(oauth_token, oauth_verifier);
oauth_token = null;
oauth_verifier = null;
}
tmrCloseCheck.Interval = 2000;
tmrCloseCheck.Tick += new EventHandler(tmrCloseCheck_Tick);
tmrCloseCheck.Start();
ShowOfflienContent("Completed.htm");
}
}
开发者ID:fyasar,项目名称:LinkedIn-Windows-Client,代码行数:32,代码来源:Authorize.cs
示例6: LoginBrowser_Navigated
private void LoginBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (e.Url.ToString().Contains("#"))
{
string id="", expires="", token="", get=e.Url.ToString();
try
{
get = get.Split('#')[1]; //erase trash like http:
token = get.Split('&')[0].Split('=')[1]; //take string between = and &
expires = get.Split('=')[2].Split('&')[0]; //take expires_in=__&
id = get.Split('=')[3];//get user id, its 3 '='
}
catch { }
this.si = new SessionInfo();
this.si.AppId = this.AppId;
this.si.Permissions = this.Permissions;
this.si.Token = token;
this.si.UserId = Convert.ToInt32(id);
this.si.Expire = Convert.ToInt32(expires);
this.LoginInfoReceived = true;
this.Close();
}
}
开发者ID:Vnv192,项目名称:vk_music,代码行数:25,代码来源:BrowserAuthorization.cs
示例7: WebBrowser_Navigated
private async void WebBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
// Check if the current URL contains the authorization token
var authorizationCode = OneDriveApi.GetAuthorizationTokenFromUrl(e.Url.ToString());
// Verify if an authorization token was successfully extracted
if (!string.IsNullOrEmpty(authorizationCode))
{
// Get an access token based on the authorization token that we now have
await OneDriveApi.GetAccessToken();
if (OneDriveApi.AccessToken != null)
{
DialogResult = DialogResult.OK;
Close();
return;
}
}
// If we're on this page, but we didn't get an authorization token, it means that we just signed out, proceed with signing in again
if (e.Url.ToString().StartsWith(OneDriveApi.SignoutUri))
{
var authenticateUri = OneDriveApi.GetAuthenticationUri();
WebBrowser.Navigate(authenticateUri);
}
}
开发者ID:einharjarn,项目名称:KeePassOneDriveSync,代码行数:25,代码来源:OneDriveAuthenticateForm.cs
示例8: OnNavigated
private async void OnNavigated(object sender, WebBrowserNavigatedEventArgs e)
{
Debug.WriteLine("Navigated " + e.Url);
// Pre-Authorization performed?
if (m_isPreAuthorization)
{
m_isPreAuthorization = false;
m_browser.Navigate(m_provider.AuthorizationUrl);
return;
}
// we need to ignore all navigation that isn't to the redirect uri.
if (!e.Url.ToString().StartsWith(m_provider.RedirectionUrl.ToString(), StringComparison.OrdinalIgnoreCase))
{
return;
}
try
{
var isOk = await m_provider.Claim(e.Url, m_browser.DocumentTitle);
DialogResult = isOk ? DialogResult.OK : DialogResult.Cancel;
}
catch
{
DialogResult = DialogResult.Cancel;
}
finally
{
m_browser.Stop();
Close();
}
}
开发者ID:alexmbaker,项目名称:KeeAnywhere,代码行数:34,代码来源:OAuth2Form.cs
示例9: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (Process.HasExited)
{
MessageBox.Show("WebServer did not start correctly. Exited with code: " + Process.ExitCode, "Error");
}
}
开发者ID:robertlj,项目名称:IronScheme,代码行数:7,代码来源:MainForm.cs
示例10: webBrowser1_Navigated
void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (e.Url.ToString().IndexOf("http://oauth.vk.com/blank.html") != -1)
{
var urlParams = HttpUtility.ParseQueryString(e.Url.Fragment.Substring(1));
ACCESS_TOKEN = urlParams.Get("access_token");
USER_ID = urlParams.Get("user_id");
/*string uriString =
string.Format("https://api.vk.com/method/{0}.xml?oid={1}&access_token={2}",
"audio.get", "6811515", ACCESS_TOKEN);
webBrowser1.Navigate(uriString);*/
request();
}
/* if (e.Url.AbsolutePath.ToString().IndexOf("/method/audio.get.xml") != -1)
{
XmlDocument xd = new XmlDocument();
xd.LoadXml(webBrowser1.DocumentText.ToString().Replace(" "," "));
//XmlNodeList urls = xd.SelectNodes()
//var document = xd.Load(webBrowser1.DocumentStream);
}*/
}
开发者ID:fargutvest,项目名称:TriedStartUp,代码行数:28,代码来源:Form1.cs
示例11: webBrowser_Navigated
private void webBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (e.Url.AbsoluteUri.StartsWith(this.RedirectURL))
{
//http://localhost/#access_token=5dlpafwfntadj2cubro3vramcnp4c6&scope=user_read+user_subscriptions
//{http://localhost/?error=access_denied&error_description=The+user+denied+you+access}
var startIndex = e.Url.AbsoluteUri.IndexOf("#") + 1;
var response = e.Url.AbsoluteUri.Substring(startIndex);
var qs = System.Web.HttpUtility.ParseQueryString(response);
var access_token = qs["access_token"];
if (string.IsNullOrWhiteSpace(access_token))
{
Application.Exit();
return;
}
var twitchAlerts = new Alerts(access_token, this.ClientId);
this.Hide();
}
else if (e.Url.AbsoluteUri.StartsWith("https://api.twitch.tv/"))
{
this.Show();
}
}
开发者ID:ProjectTako,项目名称:TwitchAlert,代码行数:28,代码来源:TwitchAuthorization.cs
示例12: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
string urlFragment; // фрагмент параметров авторизации
if (e.Url.AbsolutePath == "/blank.html") // Если абсолютный урл равен, то авторизация прошла
urlFragment = webBrowser1.Url.Fragment;
else
urlFragment = ifLoadLogin();
if (urlFragment.IndexOf("error") != -1 || urlFragment == "") // Если авторизация прошла с ошибкой
{
this.DialogResult = DialogResult.Cancel;
return;
}
if (urlFragment.IndexOf("error") == -1) // Если нет ошибок, берём токен, время жизни и наш айди
{
vars.VARS.Token = urlFragment.Substring(14, urlFragment.IndexOf("&") - 14);
urlFragment = urlFragment.Remove(0, urlFragment.IndexOf("&") + 1);
vars.VARS.Expire = Convert.ToUInt32(urlFragment.Substring(11, urlFragment.IndexOf("&") - 11));
urlFragment = urlFragment.Remove(0, urlFragment.IndexOf("&"));
vars.VARS.Mid = Convert.ToUInt32(urlFragment.Substring(9, urlFragment.Length - 9));
}
this.DialogResult = DialogResult.OK; // Возвращаем сообщение об успехе
}
开发者ID:malstoun,项目名称:VKMessenger,代码行数:26,代码来源:AccessForm.cs
示例13: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
try
{
Uri url = e.Url;
if (url.AbsolutePath == "/blank.html")
{
var q = HttpUtility.ParseQueryString(url.Fragment.Substring(1));
if (q["error"] != null)
{
onError(q["error"], q["error_description"]);
}
else
{
onSuccess(q["user_id"], q["access_token"]);
}
Hide();
var timer = new System.Threading.Timer(_ =>
{
Close();
}, null, 10000, Timeout.Infinite);
}
}
catch (Exception ex)
{
onError(ex.Message, "");
}
}
开发者ID:alexbft,项目名称:vkaudiosync,代码行数:28,代码来源:AuthForm.cs
示例14: wbFacebookLogin_Navigated
private void wbFacebookLogin_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (e.Url.PathAndQuery.Contains("desktopapp.php"))
{
DialogResult = DialogResult.OK;
}
}
开发者ID:jeffdeville,项目名称:FacebookDeveloperToolkit---Fork-at-37335,代码行数:7,代码来源:FacebookAuthentication.cs
示例15: webBrowser_Navigated
private void webBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
//System.Diagnostics.Debug.WriteLine("Navigated to: " + webBrowser1.Url.AbsoluteUri.ToString());
// 브라우저의 html의 타이틀 값을 가져온다(이 타이틀에 code값이 적혀 있음)
if(option == LoginOption.GoogleDrive)
{
this.Text = webBrowser1.Document.Title;
if (this.webBrowser1.Document.Title.StartsWith(EndUrl))
{
// 타이틀에 적혀 있는 값을 필요한 부분만 잘라서 code에 저장
this.code = AuthResult(webBrowser1.Document.Title);
CloseWindow();
}
}
else if(option == LoginOption.OneDrive)
{
if (this.webBrowser1.Url.AbsoluteUri.StartsWith(EndUrl))
{
string[] querparams = webBrowser1.Url.Query.TrimStart('?').Split('&');
int index = querparams[0].IndexOf('=');
querparams[0] = querparams[0].Substring(index+1, (querparams[0].Length - index)-1);
this.code = querparams[0];
CloseWindow();
}
}
else if(option == LoginOption.DropBox)
{
if(webBrowser1.Document.GetElementById("auth-code") != null)
{
webBrowser1.Visible = false;
this.code = webBrowser1.Document.GetElementById("auth-code").InnerText;
CloseWindow();
}
}
}
开发者ID:leejongseok,项目名称:TeamProject,代码行数:35,代码来源:loginform.cs
示例16: AuthenticationBrowser_Navigated
private async void AuthenticationBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
// Get the currently displayed URL and show it in the textbox
CurrentUrlTextBox.Text = e.Url.ToString();
// Check if the current URL contains the authorization token
AuthorizationCodeTextBox.Text = OneDriveApi.GetAuthorizationTokenFromUrl(e.Url.ToString());
// Verify if an authorization token was successfully extracted
if (!string.IsNullOrEmpty(AuthorizationCodeTextBox.Text))
{
// Get an access token based on the authorization token that we now have
await OneDriveApi.GetAccessToken();
if (OneDriveApi.AccessToken != null)
{
// Show the access token information in the textboxes
AccessTokenTextBox.Text = OneDriveApi.AccessToken.AccessToken;
RefreshTokenTextBox.Text = OneDriveApi.AccessToken.RefreshToken;
AccessTokenValidTextBox.Text = OneDriveApi.AccessTokenValidUntil.HasValue ? OneDriveApi.AccessTokenValidUntil.Value.ToString("dd-MM-yyyy HH:mm:ss") : "Not valid";
// Store the refresh token in the AppSettings so next time you don't have to log in anymore
_configuration.AppSettings.Settings["OneDriveApiRefreshToken"].Value = RefreshTokenTextBox.Text;
_configuration.Save(ConfigurationSaveMode.Modified);
return;
}
}
// If we're on this page, but we didn't get an authorization token, it means that we just signed out, proceed with signing in again
if (CurrentUrlTextBox.Text.StartsWith("https://login.live.com/oauth20_desktop.srf"))
{
var authenticateUri = OneDriveApi.GetAuthenticationUri("wl.offline_access wl.skydrive_update");
AuthenticationBrowser.Navigate(authenticateUri);
}
}
开发者ID:victorvogelpoel,项目名称:OneDriveAPI,代码行数:35,代码来源:MainForm.cs
示例17: wbFacebookLogin_Navigated
private void wbFacebookLogin_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
//if (e.Url.PathAndQuery.Contains("authorize.php") && e.Url.Fragment == "#")
//{
// DialogResult = (_facebookService.HasPermission(_permission)) ? DialogResult.OK : DialogResult.Cancel;
//}
}
开发者ID:taoxiease,项目名称:asegrp,代码行数:7,代码来源:FacebookExtendedPermission.cs
示例18: webBrowser1_Navigated
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
textBox2.Text = webBrowser1.DocumentTitle;
toolStripStatusLabel1.Text = webBrowser1.StatusText;
textBox3.Text = webBrowser1.Url.ToString();
//toolStripProgressBar1.Value = webBrowser1.ProgressChanged;
}
开发者ID:xs2ranjeet,项目名称:13ns9-1spr,代码行数:7,代码来源:Form1.cs
示例19: WebBrowserNavigated
private void WebBrowserNavigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (IsRedirected(e.Url))
{
AuthorizationUri = e.Url;
Hide();
}
}
开发者ID:RobTillie,项目名称:exactonline-api-dotnet-client,代码行数:8,代码来源:LoginForm.cs
示例20: wbMain_Navigated
private void wbMain_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
if (!IsDisposed)
{
tstbURL.Text = e.Url.ToString();
CheckCallback(e.Url.ToString());
}
}
开发者ID:Xanaxiel,项目名称:ShareX,代码行数:8,代码来源:OAuthWebForm.cs
注:本文中的System.Windows.Forms.WebBrowserNavigatedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论