It will be something like this:
Dim fname as string = "your app name goes here" & ".hr.html"
Dim sra As Reflection.Asse mbly =
Reflection.Asse mbly.GetExecuti ngAssembly
Dim str As IO.Stream = sra.GetManifest ResourceStream( fname)
Dim buf() As Byte
ReDim buf(CInt(str.Le ngth) + 100)
str.Read(buf, 0, CInt(str.Length ))
Dim s as string =
Text.Encoding.D efault.GetStrin g(buf,0,cint(st r.length))
' at this point, string s should contain the contents of your file
This code is a cut/paste/edit of some of my code that works for wav files as
embedded resources. But I have edited it, so you may need to tinker. If
your project is "foo" and you have added file as a resource as simply as
possible, then the value of fname should be "foo.hr.htm l". You may need to
fiddle with the Text.Encoding line because that one I just winged.
"Doker" wrote:
Hi.
I have embedded resource file "hr.html" added to my project.
How to load it to a String varaible named "strht"?
Thanks,
Doker