private void rbAll_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rb = (RadioButton)sender;

            if (rb.Checked)
            {
                switch (rb.Name)
                {
                case "rbDirectConnect":
                {
                    proxy = NetConnectionType.NoProxy;
                }; break;

                case "rbSystemSettings":
                {
                    proxy = NetConnectionType.SystemProxy;
                }; break;

                case "rbManual":
                {
                    proxy = NetConnectionType.ManualProxy;
                }; break;
                }
            }

            btnSystemProxy.Enabled = rbSystemSettings.Checked;
            grpProxy.Enabled       = rbManual.Checked;
        }
示例#2
0
 public NetConnectivityArgs(ConnectivityStatus conStatus, NetConnectionType conType, double?wLinkSpeed, double?eLinkSpeed, NetworkInterface currEth, WlanClient.WlanInterface currWlan)
 {
     this.ConnectionStatus = conStatus;
     this.ConnectionType   = conType;
     this.WifiLinkSpeed    = wLinkSpeed;
     this.EthLinkSpeed     = eLinkSpeed;
     this.CurrentEthIf     = currEth;
     this.CurrentWlanIf    = currWlan;
 }
示例#3
0
        public string AccessKey;  // NET_ACCESS_KEY_LEN

        public void Deserialize(BinaryReader reader)
        {
            Type        = reader.Read <NetConnectionType>();
            AddressList = reader.Read <NetAddressList>();
            WorldID     = reader.ReadInt32();
            ServerKey   = reader.Read <RSA_KEY>();
            SessionKey  = reader.ReadString(MediusConstants.NET_SESSION_KEY_LEN);
            AccessKey   = reader.ReadString(MediusConstants.NET_ACCESS_KEY_LEN);
            reader.ReadBytes(2);
        }
示例#4
0
 private void UIUpdateWlanInfo(NetConnectionType connectionType, WlanClient.WlanInterface currentWlanIf, double?wifiLinkSpeed)
 {
     try
     {
         if (connectionType == NetConnectionType.EthWifi || connectionType == NetConnectionType.Wireless)
         {
             if (currentWlanIf != null)
             {
                 string ipAddress = string.Empty;
                 foreach (var address in currentWlanIf.NetworkInterface.GetIPProperties().UnicastAddresses)
                 {
                     if (address.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                     {
                         ipAddress = address.Address.ToString();
                     }
                     // UnicastIPAddressInformation.Address = {192.168.1.178} | AddressFamily = InterNetwork | PrefixOrigin = Dhcp || Address = {fe80::d9e7:80a9:764c:344b%8} | AddressFamily = InterNetworkV6 | PrefixOrigin = WellKnown
                 }
                 if (string.IsNullOrWhiteSpace(ipAddress))
                 {
                     ipAddress = currentWlanIf.NetworkInterface.GetIPProperties().UnicastAddresses[0].Address.ToString();
                 }
                 LabelWlanIPValue.Content    = ipAddress;
                 LabelWlanMacValue.Content   = Network.ConvertMacAddrToColonNotation(currentWlanIf.NetworkInterface.GetPhysicalAddress().ToString());
                 LabelWlanSpeedValue.Content = Network.GetSpeedString(wifiLinkSpeed);
             }
             else
             {
                 SetDefaultWlanUI();
             }
         }
         else
         {
             SetDefaultWlanUI();
         }
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
示例#5
0
        public static void TriggerNetConnectivityUpdate(ConnectivityStatus conStatus, NetConnectionType conType, double?wLinkSpeed, double?eLinkSpeed, NetworkInterface currEth, WlanClient.WlanInterface currWlan)
        {
            NetConnectivityArgs args = new NetConnectivityArgs(conStatus, conType, wLinkSpeed, eLinkSpeed, currEth, currWlan);

            NetConnectivityChanged(args);
        }