[W8.1] [C#]如何在winrt c中的Web视图中加载本地.css文件 [英] [W8.1][C#]how to load local .css file in web view in winrt c#

查看:93
本文介绍了[W8.1] [C#]如何在winrt c中的Web视图中加载本地.css文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have one .html file , respective .css file and some images in local folder. If i open this .html file in any browser then it's working fine (.css and all images are showing properly). But when i open this in my winrt 8.1 app , only html file is getting load to webview. css and all images is not getting load in my webview.

我的代码如下:

private async void Button_Click_1(object sender,RoutedEventArgs e)
{
string filename =" myfile.xhtml" ;;
Windows.Storage.StorageFile sampleFile = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);
string str = await PathIO.ReadTextAsync(sampleFile.Path);
webview.NavigateToString(str);
}




推荐答案

b


这是Visual C#论坛。由于您的问题与Web有关,请将您的问题提交到ASP.Net论坛以获得快速响应。我正在将你的主题转移到偏离主题的位置。



https: //forums.asp.net/



您的理解与合作将不胜感激。
Hi,

This is Visual C# forum. As your issue is related to Web, please ask your question into ASP.Net forum for getting quick response. I am moving your thread to off-topic.

https://forums.asp.net/

Your understanding and cooperation will be grateful.


这篇关于[W8.1] [C#]如何在winrt c中的Web视图中加载本地.css文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆