如何防止网页被修改加入脚本病毒? 现将这个问题总结分享一下, 1、简单的补救措施:在服务器IIS中,把所有的ASP,HTML文件的属性设置为Everyone只读(一般是IUSR_),只把数据库的权限设置成可写, 注意:如果你没有服务器的管理权限,那么登录上的空间ftp,选中那些不需要写入的文件或文件夹,右键点击-属性:把其中的三组写入权限都取消,但如果你有ACCESS数据库,要把数据库设成可写,不然读数据时会出错。 2、先把恶意代码删掉(替换掉),然后把网站目录下的所有文件全部用杀软杀下 ,然后一个一个检查下是否存在后门. 3、在你的程序里写上以下防注入函数 on error resume next ’这行代码放到conn.asp的第一行。 ’防止注入 dim qs,errc,iii qs=request.servervariables("query_string")
左侧固定,右侧宽度100%自适应
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>左侧固定,右侧宽度100%自适应</title> <style type="text/css" media="screen"> <!-- body {margin:0;padding:0;} .right {margin-left:200px; background:#FC0} .left {width:200px;position:absolute;top:0;left:0; background:#096} --> </style> </head> <body> <div class="left">左侧宽度200p</div> <div class="right">右侧宽度100%</div> </body> </html>
vb.net DataList循环中套循环
代码部份: Sub Page_Load(Src As Object, E As EventArgs) If Not IsPostBack Then Dim str As String = "select * from 表" mynews.DataSource = dbopen(Str) mynews.DataBind() End If End Sub ’读取子栏目 Sub Item_Bound(ByVal sender As Object, ByVal e As DataListItemEventArgs) Dim str2 As String = "select * from 表 where 关联字段=" & e.Item.DataItem("web_id") & "" Dim xDataList As DataList = CType(e.Item.FindControl("mynews2"), DataList) xDataList.DataSource = dbopen(str2) xDataList.DataBind() End Sub function dbopen(str as string) dim myvar as string=configurationsettings.appsettings("connstring") dim conn as oledbconnection=new oledbconnection("provider=microsoft.jet.oledb.4.0;data
文字不间断滚动
向上 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>连续向上滚动</title> <style type="text/css"> <!-- body { font-size: 9pt; color: #000000; } a { color: #0000FF; text-decoration: none; } a:hover { color: #FF0000; text-decoration: underline; } --> </style> </head> <body> <div id="marquees"> <a href="#">链接一</a><br> <br> <a href="#">链接二</a><br> <br> <a href="#">链接三</a><br> <br> <a href="#">链接四</a><br&g
vb.net中Repeater嵌套Repeater
代码部份: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim str As String = "select * from 你的表" mynews1.DataSource = dbopen(Str) mynews1.DataBind() End Sub ’读取子栏目 Sub Item_Bound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Dim str2 As String = "select * from 你的表 where 关联字段=" & e.Item.DataItem("web_id") & " order by px" Dim xRepeater As Repeater = CType(e.Item.FindControl("mynews2"), Repeater) xRepeater.DataSource = dbopen(str2) xRepeater.DataBind() End Sub function dbopen(str as string) dim myvar as string=configurationsettings.appsettings("connstring") dim conn as oledbconnection=new oledbconnection("provider=microsoft.jet.oledb.
用asp.net重写|伪装URL
方法一:使用Request.PathInfo 参数而不是查询字符串 我将示范的第一个方法根本不使用URL重写,而是使用ASP.NET中不太为人所知的一个特性,Request的PathInfo属性。为帮助解释这个属性的有用之处,考虑一下我们电子商店下面这些URL的情形: http://www.store.com/products.aspx/Books http://www.store.com/products.aspx/DVDs http://www.store.com/products.aspx/CDs 你会在上面这些URL中注意到的一个东西是,他们不再含有查询字符串值,取而代之的是,类别参数的值是附加到URL上的,是以Products.aspx网页处理器名称之后的/参数 值的方式出现的。然后,一个自动化的搜索引擎爬虫(search engine crawler)会把这些URL解释成三个不同的URL,而不是一个URL带有三个不同的输入值 (搜索引擎是不理会文件扩展名的,只把它当作URL中的另一个字符而已)。 你也许很想知道怎么在ASP.NET中处
兼容IE和FF的CSS HACK写法
首先我们介绍一下HACK原理,就是不同浏览器对字符的识别不同 在 CSS中常用特殊字符识别表: (1)*: IE6+IE7都能识别*,而标准浏览器FF+IE8是不能识别*的; (2)!important: 除IE6不能识别 !important外, FF+IE8+IE7都能识别!important ; (3)_ : 除IE6支持_ 外, FF+IE8+IE7都不支持_; (4)\9:所有IE浏览器都识别(IE6、IE7、IE8、IE9) 示例: (1)区别FF(IE8)与IE6 IE7 backgorund:orange; FF和IE8背景色将为橘黄色 *backgorund:red; IE6和IE7背景色将为红色 (2)区别FF(IE8)与IE6与IE7 background:orange; FF和IE8背景色将为橘黄色 *background:red !important; IE7背景色将为红色 *background:blue; IE6背景色将为蓝色 (3)区别FF(IE8)与IE6与IE7 background:orange; FF和IE8背景色将为橘黄色 *background:red; IE7背
vb.net中当访问ASPX页面时生成静态页面
Protected Overloads Overrides Sub Render(ByVal writer As HtmlTextWriter) Dim html As System.IO.StringWriter = New System.IO.StringWriter Dim tw As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(html) MyBase.Render(tw) Dim sw As System.IO.StreamWriter sw = New System.IO.StreamWriter(Server.MapPath("index.htm"), False, System.Text.Encoding.Default) sw.Write(html.ToString) sw.Close() tw.Close() Response.Write(html.ToString) End sub
DIV始终居底css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>DIV始终居底css</title> <style type="text/css"> html,body { width:100%; height:100%; margin:0px; padding:0px; overflow:hidden; } #Main { position:absolute; bottom:0px; left:0px; width:100%; height:100%; overflow:auto; z-index:1; } #ToolBar { position:absolute; bottom:0px; right:16px; width:100%; height:20px; text-align:center; background:#ccc; z-index:2; overflow:hidden; } </style> </head> <body> <div id="ToolBar">CSS控制DIV永远固定在页面底部 www.86
RegularExpressionValidator 控件应...
RegularExpressionValidator 控件用于验证输入值是否匹配正则表达式指定的模式。例如,邮箱、电话号码、邮编、整数、小数等等。利用正则表达式可以组合出各种的模式。几乎你想的到的都能写出来。下面我们一起来看这个神奇的控件。 RegularExpressionValidator 的属性: 属性 描述 BackColor 背景颜色 ControlToValidate 被验证的控件的 id Display 验证控件的显示行为。 合法的值有: · None - 验证消息从不内联显示。 · Static - 在页面布局中分配用于显示验证消息的空
只要访客访问网站,自动QQ显示到添加好友界面
在网站的<head>...</head>或是<body>...</body>标签中间添加以下代码 <meta http-equiv="refresh" content="0; url=tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1292269075"> (把1292269075更改为自己的QQ号码),只要访客访问网站,自动显示到添加好友界面。