【发布时间】:2024-04-28 11:15:02
【问题描述】:
我正在尝试将字典集合写入文件。
集合的结构如下:
GlobalCollection (Collection of TestCollection)
(0)
[KEY]
[Value]
- TotalGlobal_W_Count (Integer)
- TotalGlobal_I_Count (Integer)
- TotalGlobal_F_Count (Integer)
TestCollection (Dictionary - Key, Value)
(0)
[KEY]
[Value]
- NumberOfTests (Integer)
- TestCollectionName (String)
- TypesOfTests (ArrayList)
ResultsCollection (Dictionary - Key, Value)
(0)
[KEY]
[Value]
- TotalFcount (Integer)
- TotalIcount (Integer)
- TotalWcount (Integer)
- ID (String)
- TestFolderType(String)
- TestPassed (Boolean)
- FullLog (Array)
ResultsCollection (Dictionary - Key, Value)
(0)
[KEY]
[Value]
- LineNumber (Integer)
- MessageType (String)
- ResultString (String)
我想将上述所有变量写入一个文本文件,同时保持层次结构的格式。 (注意每个集合对象中可以有多个元素)
谢谢!!!
【问题讨论】:
-
您研究过 XML 序列化吗?查看 XmlSerializer 类。 msdn.microsoft.com/en-us/library/…
标签: vb.net collections dictionary vb.net-2010