コード例 #1
0
        private XmlElement IPADRESS_INFO(XmlDocument doc, DataTable data)
        {
            XmlElement ip_INFO = doc.CreateElement("IpAddress");

            List <PropertyInfo> P_List  = new List <PropertyInfo>();
            IpAddress           address = IpAddress.Get();

            P_List.AddRange(address.GetType().GetProperties());



            for (int i = 0; i < P_List.Count(); i++)
            {
                XmlElement tmp_Elm = doc.CreateElement(P_List[i].Name);

                string[] columnNames = data.Columns.Cast <DataColumn>()

                                       .Select(x => x.ColumnName)

                                       .ToArray();

                tmp_Elm.InnerText = columnNames[i].ToString();

                ip_INFO.AppendChild(tmp_Elm);
            }



            return(ip_INFO);
        }