泛型类CSV(所有属性) [英] Generic class to CSV (all properties)

查看:176
本文介绍了泛型类CSV(所有属性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林寻找一种方式,从所有的类实例创建CSV。

Im looking for a way to create CSV from all class instances.

我要的是,我可以在任何类(所有实例)导出为CSV。

What i want is that i could export ANY class (all of its instances) to CSV.

some1能告诉我这个可能的解决方案(在已anwsered情况)。

Can some1 direct me to possible solution for this (in case already anwsered).

感谢名单!

推荐答案

其实,类似的事情已经在这里解决:

Actually, something similar has been addressed here:

HTTP://计算器.COM /问题/ 1179816 /最佳实践换序列化对象到一个定制字符串格式可直接使用的功能于一鸥

这是对你有用?

有是使用反射拉出字段名称和值,并把它们添加到字符串的样本。

There is a sample that uses reflection to pull out the field names and values and append them to a string.

这篇关于泛型类CSV(所有属性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆