private string T_account (object[] list)
{
StringBuilder code = new StringBuilder ();
Get data type
Type t = list[0]. GetType ();
list<string> str = new list<string> ();
Get all fields of type
fieldinfo[] fields = T.getfields (BindingFlags.NonPublic | BindingFlags.Instance);
Code. Appendline ("<table class= ' mytable ' ><thead><tr>");
foreach (FieldInfo fi in fields)
{
Extract the post-compilation field name
Match m = Regex.match (FI. Name, @ "(?<=\<). + (?=\>)");
Code. Append ("<td>"). Append (M.value). Appendline ("</td>");
Str. ADD (M.value);
}
Code. Appendline ("</tr>");
for (int i=0;i<list. length;i++)
{
Object Ob=activator.createinstance (t);
Code. Appendline ("<tr>");
foreach (FieldInfo fi in fields)
{
Extract the post-compilation field name
Match m = Regex.match (FI. Name, @ "(?<=\<). + (?=\>)");
Get the value of the corresponding field of the class
Code. Append ("<td>"). Append (FI. GetValue (List[0])). Appendline ("</td>");
Str. ADD (M.value);
}
Code. Appendline ("</tr>");
}
Code. Appendline ("</table>");
string s = code. ToString ();
Return code. ToString ();
}
Get the type of the object[] array by reflection and the values of the fields and fields to which this type is