asp如何将字符串内容转换为2进制数据,要实现字符串到2进制的转换,可以使用adodb.stream对象写入字符串,然后设置stream的type为1,即指定或返回的数据类型为2进制,然后就可以读取2进制数据流了。 asp如何将字符串内容转换为2进制数据流源代码如下function TextToBinary(text) dim bindata,stream set stream=server.CreateObject(ad..
asp使用CDO.Message组件发邮件示例-远程Server需要身份验证 Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). Const cdoAnonymous = 0 'Do not authenticate Const cdoBa..
今天修改一个asp程序,使用了存储过程,存储过程中使用sp_cursoropen/sp_cursorfetch来获取构造的sql语句获取分页数据,发现总记录数能获取到,但是就是无法获取到返回的记录集合。在SQL Server Management Studio执行存储过程,sql为asp输出的sql语句,发现尽然出现了2个结果集,一个是一条记录也没有的,另外一个是有结果的,如下图所示 ..
asp批量添加修改删除操作示例,包括js客户端数据有效性验证,服务器端自己添加验证。titleasp批量添加修改删除操作示例/title%if request.Form(op)=update then'表单提交 ids=request.Form(ids) if ids then response.Write 要删除的数据id集合:idsbr '=========数据库删除操作 conn.execute(delete from xxx where id in(..
asp对数组随机取值,不重复取同一个数组里面的值。源代码如下Function rndint(byval MaxNum,byval MinNum)'asp生成整数之间的随机数函数 dim tmp if MaxNumMinNum then tmp=MinNum:MinNum=MaxNum:MaxNum=tmp end if Randomize rndint=int(rnd *(MaxNum-MinNum+1)+MinNum)End Function'arr:数组'num:要取的个数funct..
asp可以使用adodb.stream读取图片文件后动态输出。通过动态输出图片对象,就可以统计图片访问的次数或者对图片引用来源进行判断,做一些简单的图片防盗链功能之类的。 如img src=readimg.asp?img=文件名/readimg.aspfunction getMIME(v) if instr(v,.gif)0 then geMIME=image/gif elseif instr(v,.png)0 then geMIME=image/png ..
asp时间戳和时间对象相互转换源代码'把标准时间转换为UNIX时间戳Function ToUnixTime(strTime, intTimeZone) If IsEmpty(strTime) or Not IsDate(strTime) Then strTime = Now If IsEmpty(intTimeZone) or Not isNumeric(intTimeZone) Then intTimeZone = 0 ToUnixTime = DateAdd(h,-intTimeZone,strTime) ToUnixTime = Dat..
今天访问一个本地的asp程序时,在连接SqlServer2000数据库出现下面的错误Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'[Microsoft][ODBC SQL Server Driver][DBNETLIB]一般性网络错误。请检查网络文档。 这个程序没改动过,以前都是可以运行的。最近好像安装了什么软件还是配置过什么了,导致出现这个错误。网上找..