为您的站点添加一些功能,即是设置首页或是加入收藏夹。
javascript code:
Code
//Set Home page
function SetHomePage()
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(window.location.href);
}
function GetContentWnd(){
return parent;
}
//Add Favorite
function OnAddFavorite(){
var oWnd = GetContentWnd();
window.external.addFavorite( oWnd.location.href, oWnd.document.title );
}
格式化Hyperlink:
Code
void HyperlinkParse(HyperLink lnk, string strUrl)
{
//Uri相关资讯:http://msdn.microsoft.com/zh-cn/library/ms131565.aspx
Uri objUrl = new Uri(strUrl, UriKind.RelativeOrAbsolute);
lnk.NavigateUrl = objUrl.ToString();
}
文件格式:.wmv;大小:6,490KB;长度:00:09:47。
下载地址:http://download.cnblogs.com/insus/ASPDOTNET/SetHomePageAndAddFavorite.zip