复制代码 代码如下:
using system;
using system.linq;
using system.reflection;
namespace lucienbao.common
{
public static class tostringhelper
{
public static string tostring(object obj)
{
type t = obj.gettype();
fieldinfo[] fis = t.getfields();
return string.join(environment.newline,
fis.select<fieldinfo, string>
(p => p.name + ":" + p.getvalue(obj).tostring()).toarray()
);
}
}
}
您可能感兴趣的文章:
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!
网友评论