Torna al Thread

Type type = enumerator.Current.GetType(); PropertyInfo[] infoArray = type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty); foreach (PropertyInfo info in infoArray) { object[] atts = info.GetCustomAttributes(typeof(BrowsableAttribute), true); if ((atts.Length == 1) && ((atts[0] as BrowsableAttribute) != null) && (((BrowsableAttribute)atts[0]).Browsable == false)) continue; else { object value = info.GetValue(enumerator.Current, null); if (Math.IsDate(value) || Math.IsNumeric(value) || (value is string)) worksheet.Cell(row, column).Value = info.Name; else continue; } column++; }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5