摘要: '-------------链接MSSQL,建立数据集-------------------------'引入Microsoft ActiveX Data Objects 2.5 LibraryDim Conn As New ADODB.ConnectionDim theSource As New ADODB.CommandDim theRS As New ADODB.RecordsetConn.Open "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Cat 阅读全文
posted @ 2013-09-08 20:15 巫妖天下 阅读(180) 评论(0) 推荐(0) 编辑
摘要: '先引入Microsoft XML,v4.0Function PostXML(url As String, xml As String) As String Dim I As Integer 'xml = "" Dim h As MSXML2.ServerXMLHTTP40 Dim X As MSXML2.DOMDocument40 Set X = New MSXML2.DOMDocument40 X.loadXML xml Set h = New MSXML2.ServerXMLHTTP40 h.Open "POST", url, F. 阅读全文
posted @ 2013-09-08 20:13 巫妖天下 阅读(363) 评论(0) 推荐(0) 编辑
摘要: '=======GET方式获取网页源代码================Function GetCode(Url As String, CodeBase As String) '第一个参数是地址,第二个参数是设置编码方式(GB2312或UTF-8). Dim xmlHTTP1 Set xmlHTTP1 = CreateObject("Microsoft.XMLHTTP") xmlHTTP1.Open "get", Url, True xmlHTTP1.send While xmlHTTP1.readyState 4 DoEvents .. 阅读全文
posted @ 2013-09-08 20:11 巫妖天下 阅读(877) 评论(0) 推荐(0) 编辑
摘要: 'url编码Function URLEncode(strParameter)Dim s As StringDim I As IntegerDim intValue As IntegerDim TmpData() As Byte s = "" TmpData = StrConv(strParameter, vbFromUnicode) For I = 0 To UBound(TmpData) intValue = TmpData(I) If (intValue >= 48 And intValu... 阅读全文
posted @ 2013-09-08 20:07 巫妖天下 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 'Response.CacheControl = "no-cache" set xml = Server.CreateObject("MSXML2.domdocument") xml.load Server.MapPath("system.xml") '如果有错,报错if xml.parseError.errorCode 0 then Response.Write "xml.parseError.errorCode = " &xml.parseError.errorCode & &q 阅读全文
posted @ 2013-09-08 15:29 巫妖天下 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 'tmp = ReadFileFrom("xxxx.html","utf-8")'Call WriteFileTo("../index.html",content,"utf-8")'********************************'fc:文件内容,f:文件路径,cset:文件编码'********************************Function WriteFileTo(f,fc,cset) Dim objStream Set objStream 阅读全文
posted @ 2013-09-08 15:23 巫妖天下 阅读(315) 评论(0) 推荐(0) 编辑
摘要: '=========================' 获取以时间毫秒唯一数值'=========================Function GETTIMER() dim abc abc = now() GETTIMER = right(year(abc),2) & right("0" & month(abc),2) & right("0" & day(abc),2) & (timer()*100)End Function '=========================& 阅读全文
posted @ 2013-09-08 15:19 巫妖天下 阅读(147) 评论(0) 推荐(0) 编辑
摘要: function UTF2GB(UTFStr) for Dig=1 to len(UTFStr) if mid(UTFStr,Dig,1)="%" then if len(UTFStr) >= Dig+8 then GBStr=GBStr & ConvChinese(mid(UTFStr,Dig,9)) Dig=Dig+8 else GBStr=GBStr & mid(UTFStr,Dig,1) end if else GBStr=GBStr & mid(UTFStr,Dig,1... 阅读全文
posted @ 2013-09-08 15:16 巫妖天下 阅读(394) 评论(0) 推荐(0) 编辑
摘要: agent=request.servervariables("http_user_agent")股沟--------------Mozilla/5.0 (Windows NT 5.2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7火狐--------------------------Mozilla/5.0 (Windows NT 5.2; rv:12.0) Gecko/20100101 Firefox/12.0360---------------------------Mozil 阅读全文
posted @ 2013-09-08 15:13 巫妖天下 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 'http://www.xxxx.com/?thread-1-2.htmlurl=Request.ServerVariables("QUERY_STRING")bigID = "" '大类IDsmallID = "" '新闻ID'//判断是否含有 thread- 和 .htmlIf InStr(url, "thread-") > 0 And InStr(url, ".html") > 0 Then url = Replace(url, "th 阅读全文
posted @ 2013-09-08 15:11 巫妖天下 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Function showsize(filename) FPath=server.mappath(filename) '本目录下 set fso=server.CreateObject("scripting.filesystemobject") If fso.fileExists(FPath) Then Set f = fso.GetFile(FPath) filetype=f.type filesize=f.size adddate=f.DateCreated ... 阅读全文
posted @ 2013-09-08 14:54 巫妖天下 阅读(184) 评论(0) 推荐(0) 编辑
摘要: '根据tag获取con的左侧字符串Function GetLeftPart(Con, tag) if instr(con,tag)>0 then GetLeftPart = Left(Con, InStr(Con, tag) - 1) else GetLeftPart = "" end ifEnd Function'根据tag1和tag2获取con的中间字符串Function GetBetweenPart(Con, tag1, tag2) if instr(con,tag1)>0 and instr(con,tag2)>0 then Get 阅读全文
posted @ 2013-09-08 14:37 巫妖天下 阅读(186) 评论(0) 推荐(0) 编辑
摘要: function http_GET(strUrl,strData) 'strUrl = "http://58.37.101.10/edit.asp" 'strData = "a=1&b=2" Dim objXMLHTTP, xml Set xml = Server.CreateObject("Microsoft.XMLHTTP") 'Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP") httpsendurl = strUrl & 阅读全文
posted @ 2013-09-08 13:08 巫妖天下 阅读(312) 评论(0) 推荐(0) 编辑
摘要: '日志记录(文本追加生成)sub writeTxt(str,p) Set FSO=Server.CreateObject("Scripting.FileSystemobject") path=Server.MapPath(p) if FSO.FileExists(path) then Set text=FSO.OpenTextFile(path,8) else Set text=FSO.CreateTextFile(path,2) end if text.WriteLine(str) text.WriteLine("") ... 阅读全文
posted @ 2013-09-08 12:03 巫妖天下 阅读(385) 评论(0) 推荐(0) 编辑
摘要: Response.CodePage = 65001Response.Charset="UTF-8"'-------错误Miss---------On Error Resume Next'--------------------提交方式-------------if Request.ServerVariables("REQUEST_METHOD")="POST" then'--------------------链接数据库access------------- dim conn,connstr on error 阅读全文
posted @ 2013-09-08 11:20 巫妖天下 阅读(163) 评论(0) 推荐(0) 编辑