Пример #1
0
        private void RemoveRoutePolicy_Click(object sender, RoutedEventArgs e)
        {
            if (rootPage.g_ConnectionSession == null)
            {
                OutputText.Text = "Please establish a connection using the \"Create Connection\" scenario first.";

                return;
            }

            try
            {
                HostName hostName = new HostName(HostName.Text);
                DomainNameType domainNameType = ParseDomainNameType(((ComboBoxItem)DomainNameTypeComboBox.SelectedItem).Content.ToString());
                RoutePolicy routePolicy = new RoutePolicy(rootPage.g_ConnectionSession.ConnectionProfile, hostName, domainNameType);

                Windows.Networking.Connectivity.ConnectivityManager.RemoveHttpRoutePolicy(routePolicy);

                OutputText.Text = "Removed Route Policy\nTraffic to " + routePolicy.HostName.ToString() +
                    " will no longer be routed through " + routePolicy.ConnectionProfile.ProfileName;
            }
            catch (ArgumentException ex)
            {
                OutputText.Text = "Failed to remove Route Policy with HostName = \"" + HostName.Text + "\"\n" +
                    ex.Message;
            }
        }
Пример #2
0
		/// <summary>
		/// Removes a previously specified RoutePolicy from the Http stack
		/// (WinInet).
		/// </summary>
		/// <param name="RoutePolicy">The RoutePolicy to remove.</param>
		public static void RemoveHttpRoutePolicy( RoutePolicy RoutePolicy )
		{
			throw new NotImplementedException();
		}