Android的webview加载本地html、本apk内html和远程URL
首先在layout文件夹下的xml中 加入WebView控件
<WebView
android:id="@+id/wv1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
再在主文件中输入如下代码
public class TestDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView wView = (WebView)findViewById(R.id.wv1);
WebSettings wSet = wView.getSettings();
wSet.setJavaScriptEnabled(true);
//wView.loadUrl("file:///android_asset/index.html");
//wView.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");
wView.loadUrl("http://wap.baidu.com");
}
}
//wView.loadUrl("file:///android_asset/index.html");
-----打开本包内asset目录下的index.html文件
//wView.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");
-----打开本地sd卡内的index.html文件
//wView.loadUrl("http://wap.baidu.com");
-----打开指定URL的html文件
相关文档:
IIS配置.html的映射问题,其实这个问题可以说是HttpHandlerFactory的在web.config中注册的问题
问题描述:
一套网站程序使用URL重写,配置了ISAPI映射.html 动作全部,检查文件是否存在 不打勾 如下图
问题: 不对IIS配置.html的映射,IIS站点目录下.html页面都能显示。当配置了.html的映射 ......
HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP:
header("Expires: Mon, 26 Jul 1997 ......
代码如下:
Function RemoveHTML(strText)
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
RemoveHTML = replace(RemoveHTML," "," ")
End Function
这是最基本的正则替换,有某些特殊字符还没过滤,可自行添加 ......
<html>
<head>
<title>标题<title>
</head>
<body>..........文件内容..........
</body>
</html>
1.文件标题
<title>..........</title>
2.文件更新--<meta>
【1】10秒后自动更新一次
<meta http-equiv="refresh" content=10>
【2】10秒后自动连结到另一文件
<meta http-equiv="ref ......