コード例 #1
0
 void IGXDLMSBase.Save(GXXmlWriter writer)
 {
     writer.WriteElementString("DataLinkLayerReference", DataLinkLayerReference, 2);
     writer.WriteElementString("IPAddress", IPAddress.ToString(), 3);
     writer.WriteStartElement("MulticastIPAddress", 4);
     if (MulticastIPAddress != null)
     {
         foreach (IPAddress it in MulticastIPAddress)
         {
             writer.WriteElementString("Value", it.ToString(), 4);
         }
     }
     writer.WriteEndElement();
     writer.WriteStartElement("IPOptions", 5);
     if (IPOptions != null)
     {
         foreach (GXDLMSIp4SetupIpOption it in IPOptions)
         {
             writer.WriteStartElement("IPOption", 5);
             writer.WriteElementString("Type", (int)it.Type, 5);
             writer.WriteElementString("Length", it.Length, 5);
             writer.WriteElementString("Data", GXDLMSTranslator.ToHex(it.Data), 5);
             writer.WriteEndElement();
         }
     }
     writer.WriteEndElement();
     writer.WriteElementString("SubnetMask", SubnetMask.ToString(), 6);
     writer.WriteElementString("GatewayIPAddress", GatewayIPAddress.ToString(), 7);
     writer.WriteElementString("UseDHCP", UseDHCP, 8);
     writer.WriteElementString("PrimaryDNSAddress", PrimaryDNSAddress.ToString(), 9);
     writer.WriteElementString("SecondaryDNSAddress", SecondaryDNSAddress.ToString(), 10);
 }
コード例 #2
0
 public override string ToString()
 {
     return("{" + Ip.ToString() + " - " + SubnetMask.ToString() + " - " + Gateway.ToString() + "}");
 }
コード例 #3
0
ファイル: NetworkAdapter.cs プロジェクト: ewin66/winipchanger
        /// <summary>
        /// 文字列配列型のサブネットマスクを取得します。
        /// </summary>
        public string[] GetSubnetMaskStringArray() => SubnetMask == null ? new string[]
        {
            "255.255.255.0"
        }

                                                                                                            : new string[] { SubnetMask.ToString() };