Loading internal text file as XML

2020-04-10 04:09发布

问题:

I'm writing a VB.NET app where I want to load an internal text file from Resource.

But the code shows Invalid URI: The Uri string is too long.

The code is

'document.Load("C:\Users\Sou\Documents\Visual Studio 2010\Projects\info.xml")
document.Load(My.Resources.info)
'some processing job with XML node ...

So, how to load the resource file ?

回答1:

Dim xdc As New XmlDocument
xdc.LoadXml(My.Resources.info)
MsgBox(xdc.OuterXml)