How to get the comment from a .resx file entry

淺唱寂寞╮ 提交于 2019-12-10 17:31:38

问题


Strings in resource files have a name, a value and a comment
The ResXResourceReader class gives me access to the name and the value.
Is there a way to read the comment?


回答1:


You should be able to get Comment via ResXDataNode class: http://msdn.microsoft.com/en-us/library/system.resources.resxdatanode.aspx

You will need to set UseResXDataNodes flag on the reader: http://msdn.microsoft.com/en-us/library/system.resources.resxresourcereader.useresxdatanodes.aspx




回答2:


This way seems to work ONLY for .RESX file on disk. If you usethe embedded version, comments seems to be removed.



来源:https://stackoverflow.com/questions/12902179/how-to-get-resource-file-comment-from-resourceset

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!