9

I am using a web browser control that display html page in window form now I want to embed html and javascript files and css files as resource.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nasir Mahmood
  • 1,445
  • 1
  • 13
  • 18

2 Answers2

3
  • Add your resource files - HTML, CSS, JS files etc. to your Visual Studio project.
  • Select the file and goto Properties window for that file by pressing F4.
  • Set the "Build Action" property to "Embedded Resource"
  • Re-compile the application
  • Use the following answer to get the embedded resource - https://stackoverflow.com/a/3314213/10458

PS: If you have a default namespace set in your project's properties, then you will have to prefix that to the file-name. For example if your file-name is File1.html and your default namespace is MyCompany.MyProject then you will have to use GetManifestResourceStream("MyCompany.MyProject.File1.html").

Community
  • 1
  • 1
Dhwanil Shah
  • 1,072
  • 1
  • 9
  • 25
0

Try using res: protocol. For example

res://C:\path\to\exe_or_dll\project.exe/helloworld.htm
Pavel Krymets
  • 6,253
  • 1
  • 22
  • 35