【Asp】ASP获取指定文件夹超详细信息列表

ASP获取指定目录/文件夹超详细信息/列表: <% SET Fso = CreateObject("Scripting.FileSystemObject") Set X = Fso.GetFolder(Server.MapPath(Request("Dir"))) For Each F in X.Subfolders '遍历目录     Response.Write F.Name & "/" & chr(9) '文件名     Response.Write F.DateCreated & chr(9) '创建时间     Response.Write F.DateLastAccessed & chr(9) '访问

【Asp】ASP二进制输出1*1空白小图

ASP二进制输出1*1空白小图: <% Function GetByteString(Str) '转换 Dim I For I=1 to Len(Str) GetByteString = GetByteString & ChrB(AscB(Mid(Str,I,1))) Next End Function Function MakeStr(Str) '截取字符 Dim I For I = 0 To Len(Str) / 2 MakeStr = MakeStr & "%" & Mid(Str, I * 2 + 1, 2) '每次截

【Asp】ASP下载远程文件到当前服务器

ASP下载远程文件到服务器: <% Function Download(URL,SavePath) Set A = CreateObject("ADODB.Stream") Set X = Server.CreateObject("MICROSOFT.XMLHTTP") X.Open "GET", URL, False X.Send A.Type = 1 A.Mode = 3 A.Open A.Position = 0 A.Write X.responseBody A.SaveToFile SavePath, 2 A.Close End Function Download "http://www.baidu.com/img/baidu_logo.gif",Server.mappath("csol.jpg") %>

【ASP】打包目录所有文件为2进制Mdb文件

打包程序: <% 'On Error Resume Next '容错处理 Server.ScriptTimeOut = 300 '定义脚本超时时间 Dim Fso, Rs, Conn, Stream, AdoCataLog '定义用到的组件 Set Fso = Server.CreateObject("Scripting.FileSystemObject") Set Rs = Server.CreateObject("AdoDB.RecordSet") Set Conn = Server.CreateObject("AdoDB.Connection") Set Stream = Server.CreateObject("AdoDB.Stream") Set AdoCataLog = Server.CreateObject("AdoX.CataLog") FileToMdb Server.MapPath("/") '打包根目录 Response.Write

【ASP】读取16进制输出文件/二进制数据流

读取十六进制输出文件/二进制数据流: <% HexStr="4749463839610E018100B30000F1ECF7CCCAF7544CE4918CEE706AE8ED6B68F7C1BFE94441F49D9B2319DCE10601FFFFFF00000000000000000000000021F90400000000002C000000000E0181000004FF70C949ABBD38EBCDBBFF60288E64699E68AAAE6CEBBE702CCF746DDF78AEEF7CEFFFC0A070482C1A8FC8A472C96C3A9FD0A8744AAD5AAFD8AC76CBED7ABFE0B0784C2E9BCFE8B47ACD6EBBDFF0B87C4EAFDBEFF8BC7ECFEFFBFF808182838485868788898A8B4A0102099003008C941D039098090293180304029295880099990417008F9901A286AAA590AC14A9B009B2AD81A4B590A714AFB09CB87F97BB9014C4BBBDC27E04C5B113CEC6CB7EBFB5B2C8C5B7D37AD5B0B2CDD103DB7CDDA5B2E5E6E37BE0D912E8ABEA7AD8B513EF98F171000103A113BAC913D801C4E726402902C1DEDD9A078C601B83B03649F877709633710ED7D0AA2560024389C7FF7675CCB88661268C0B1C61EA578121C209FB06040846128CBD0422F60900750BE2499A35B750DCA5AD84CF5220836E39BA0BA58977CA94663159CA2909A6DEA46AA17A1205D7485AA7464B6015E6809DA080FA8A3632AC15AC592BA884F5D2C24D9C6EAF8C05FAD59685B1787518504098B0013F85132B567CA0C0E116080E48968C40C2D7A80BFA3EA30098C7E0C48FF92C1E3DFA40E81405141798E84CDBD0624917DC9540BAB6ED031252DBDECD980E6FDB9555E82EBC5A025CB215EEAE5CEB6CE4EFE7B8170C7F7EDB37F5D1A74D4C5750DCF82F014535A79320B016C6EBBBA36F47DF7B0EFBF628B677F71760A685E3D164E1DFFC9EB4FAC4930528E0FF8002CE07C762044E469A5A23441660701DECD71C27504D50C085186658C0018C19E0E18720E6069A040E36864189D1D5B158761520B0A20F58DD3296441B21C5E0051C26066106D37D389C6920FA089A87D68DA8418EC44D10E4921F6200409037CA650D34337212C0273B1160D5934C1AE0A262087419DA74EBA15764612C5620DF04D01500D49A1B50252360B165F0597F8959985899D79D69D80648FE49DB75A7C199015773D219A592782AA627718D2AE0A702694EF06562C1B037A66A190050DE780B0086499D16DC19E9A38679F823063D12E99E6A1A6A882005EC1DC089A115D4C84B7DBC06A3093F679902AC2AE069602A77B1267BA1A322A2D9ACFF0229AA99A71D919E26A687912D161CAEFE7C575405C859068F3BE35E702C08CC4A67E48F5D067A47A306720040A0D03E4B58BCB265422AB82861734B35654970EE07E9F668EF6FEFF617ED07C7FEB7A705F368032C4BE166566E37DF2E30B00705AF7BDDC272346A6B080D1F6CE0506D2D20908CFD5E5C8B5A1B77D0B1B3EA4257E91B918EAC24BDE999DC525530815AB1BFF598576AA485A14AE9228B298BE168DD5D4A9DC34932B79CB8E50EED724447232DA9BD06F03CF5A4376BCCF324C742E7336740932774CB98FCBB4BD7482B1D369E20BBF1A2B12F8ACD1BD5F782DBB6C559C3BD59BE535290767F76FBFD5BDE6DEC6D67D352DFCB64E5807327B8FF29DD16EED1D671313AE4B520CE6C58E5960BA9AD8A8A95BD00EACB3E6C6E7BDCBEEC0F96C54A507166C026445405317360FAD200AC676BB6AA2DCA86E4B36BBB5DA525D75C75D1156DA00907E8D04D18BAD34ABFB4C08E17A633B5B02AEBB701DB411E3DB72661F6D7EE179493B2C0E9CADCBDC114208FA0EB38E7FC3A82CAA21DA72CC2918CE98E17512A47598E45BA200D2F3BC5230D0294D7BF465506000A5B5B486083960E8A6A1730F3DAD7BC870059A52740F88A1CBC2CF59ECCC54B571F8CE1D5802742A5F1497CD579557F0C84BABF697016CA9121D79AE73F7BDDD04D11F4CFA41E3741546C2841042A0E8A0EB0A3596846005A92C9B000C312E07E41F18B030A0D8AA64819A0A02F5655CC4B07F4313160D547036CEC465AD448C73ADAF18E78CCA31EF7C8C73EFAF18F800CA4200749C8421AF290884CA42217C9C8463AF291908CA4242749C94A5AF29298CCA42637C9C94E7AF293A00CA5284749CA529AF294A84CA52A57C9CA56BAF295B08CA52C6749CB5ADAB2091100003B" Function GetByteString(Str) '转换 Dim I For I=1 to Len(Str) GetByteString = GetByteString & ChrB(AscB(Mid(Str,I,1))) Next End Function Function MakeStr(Str) '截取字符 Dim I For I = 0 To Len(Str) / 2 MakeStr = MakeStr & "%" & Mid(Str, I * 2 + 1, 2) '

【Asp】ASP 十六进制转换为二进制

ASP 十六进制转换为二进制: Function HEX_to_BIN(Hex) Dim i , B     Hex = UCase(Hex)     For i = 1 To Len(Hex)         Select Case Mid(Hex, i, 1)             Case "0": B = B & "0000"             Case "1": B = B & "0001"             Case "2": B = B & "0010"             Case "3": B = B & "0011"             Case "4":

【Asp】判断字符串只能是数字或字母组合

Asp判断字符串只能是数字或字母组合: <form method=get> <input type="text" name="txt" id="txt"/> <input type="submit"/> </form> <% if request("txt")<>""   then Dim regEx Set regEx = New RegExp regEx.Pattern = "^[a-zA-Z][^\W_]*$" if regEx.test(request("txt")) = true then response.write "正确" else response.write "错,只允许字母开头的 字母或数字

【Asp】ASP 汉字转UTF-8 UTF-8转为汉字

ASP 汉字转换为UTF-8: function chinese2unicode(Str)          for i=1 to len(Str)                  Str_one=Mid(Str,i,1)                  Str_unicode=Str_unicode&chr(38)                  Str_unicode=Str_unicode&chr(35)                  Str_unicode=Str_unicode&chr(120)                  Str_unicode=Str_unicode& Hex(ascw(Str_one))                  Str_unicode=Str_unicode&chr(59)          next          chinese2unicode = Str_unicode  end function  ASP UTF-8转换为汉字: 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                        

【Asp】Asp读取文本文件最后一行的函数

Asp读取文本文件最后一行的函数: Function getLastLine(fileName)  Dim fso,srcFileContent,tempLine  ForReading = 1  FileName = Server.MapPath(FileName)  Set fso = CreateObject("Scripting.FileSystemObject")   If fso.FileExists(fileName) Then     Set srcFile = fso.OpenTextFile(fileName, ForReading)   While Not srcFile.AtEndOfStream     tempLine = srcFile.ReadLine   Wend   Set srcFile = Nothing   Set fso = Nothing   getLastLine = tempLine  Else   getLastLine = "fi

【Asp】ASP Url编码 URL编码为UTF-8格式

ASP 将URL编码为UTF-8格式: Function URLEncodetoUTF8(url)         Dim oneChar, result               Dim oneAsc                   If url = "" Then             URLEncodetoUTF8 = url             Exit Function         End If              For i = 1 To Len(url)             oneChar = Mid(url,i, 1)             oneAsc = AscW(oneChar)                If oneAsc < 0 Then oneAsc = oneAsc + 65536               If (oneAsc And &HFF80) = 0 Then        If (oneAsc >= 65 And oneAsc <= 90) or (oneAsc >= 97 And oneAsc <= 122) or (oneAsc >= 48 And oneAsc <= 57) or oneAsc = 45 or oneAsc = 46 or oneAsc = 95 Then               result = result & oneChar            Else               result = result & "%" & Hex(oneAsc)         End If              Else                 If (oneAsc And &HF000) = 0 Then                     uch = "%" & Hex(((oneAsc \ 2 ^ 6)) or &HC0) & Hex(oneAsc And &H3F or &H80)                     result = result & uch                 Else                     uch = "%" & Hex((oneAsc \ 2 ^ 12) or &HE0) & "%" & _                     Hex((oneAsc \ 2 ^ 6) And &H3F or &H80) & "%" & _                     Hex(oneAsc And &H3F or &H80)                     result = result & uch                 End If             End If         Next  URLEncodetoUTF8 = result End Function