Install cefsharp and simple tutorial
The ie kernel used by the webbrowser that comes with vs does not support many things, so cefsharp is used here.
Access embedded resources
- Embed files in the front-end resource directory
No need to follow the link,
Resources folder, if there is no such folder, you need to double-click Resources.resx,
add a resource arbitrarily (here it is assumed to be hh.png), save it, and the Resources folder will be there (you can also create it manually).
Put all the resources into the Resources folder, and change all the resource files to embedded resources.
(Written here to find that the link seems to be better, it seems that it does not need to change the resources one by one to embedded)
- The return value type of the ProcessRequestAsync function of SchemeHandler
ResourceSchemeHandler is not bool, and an error will be reported. Just correct it according to the error report. There are several return values, and I have not studied it specifically.
There is a problem with the resource loading of the ProcessRequestAsync function, which needs to be modified slightly, refer to the following
Assembly ass = Assembly.GetExecutingAssembly();
String resourcePath = ass.GetName().Name + ".Resources." + "hh.png";
if (ass.GetManifestResourceInfo(resourcePath) != null)
{
Console.WriteLine(111);
Stream stream = ass.GetManifestResourceStream(resourcePath);
}
else
{
Console.WriteLine(222);
}
Everything else is the same as the tutorial.