【发布时间】:2015-02-15 21:25:16
【问题描述】:
如何在我的应用程序中获取嵌入资源 (.html) 的 URL,我可以像 WebControl.Source 的值一样使用它?或者有什么更好的方式打开嵌入式资源?
【问题讨论】:
标签: c# url web-applications awesomium
如何在我的应用程序中获取嵌入资源 (.html) 的 URL,我可以像 WebControl.Source 的值一样使用它?或者有什么更好的方式打开嵌入式资源?
【问题讨论】:
标签: c# url web-applications awesomium
嵌入式资源没有 URL,而是可以使用它们的命名空间来引用。了解如何使用嵌入式资源:
http://www.codeproject.com/Articles/3089/Understanding-Embedded-Resources-in-Visual-Studio
stackoverflow 上也有多个问题和答案:
【讨论】:
webView.Source = new Uri("www.yourapp.com/index.html"); 然后你需要在 ResourceInterceptor 中拦截调用:public virtual ResourceResponse OnRequest(ResourceRequest request){ if(request.Url == new Uri("www.yourapp.com/index.html")){ /*load the embedded resource and inject it*/}}