校验码的问题

cnbaobin 2005-03-24 02:58:12
第一,我对登录时校验码的作用,不是很明白。为什么要校验码。不用校验码有那些坏处。用校验码有什么好处。
第二,谁能提供,一个校验码处理的源代码。包括,产生图片校验码,后台处理校验码的源代码。
...全文
76 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzchl219 2005-03-24
  • 打赏
  • 举报
回复
<!--#include file="conn.asp"-->
<%
Class ExcelGen
Private objSpreadsheet
Private iColOffset
Private iRowOffset
Sub Class_Initialize()
Set objSpreadsheet=Server.CreateObject("OWC.Spreadsheet")
iRowOffset=2
iColOffset=2
End Sub

Sub Class_Terminate()
Set objSpreadsheet=Nothing 'Clean up
End Sub

Public Property Let ColumnOffset(iColOff)
If iColOff>0 then
iColOffset=iColOff
Else
iColOffset=2
End If
End Property

Public Property Let RowOffset(iRowOff)
If iRowOff>0 then
iRowOffset=iRowOff
Else
iRowOffset=2
End If
End Property

Sub GenerateWorksheet(objRS)
'Populates the Excel worksheet based on a Recordset's contents
'Start by displaying the titles
If objRS.EOF then Exit Sub
Dim objField, iCol, iRow
iCol=iColOffset
iRow=iRowOffset
For Each objField in objRS.Fields
objSpreadsheet.Cells(iRow, iCol).Value=objField.Name
objSpreadsheet.Columns(iCol).AutoFitColumns
'设置Excel表里的字体
objSpreadsheet.Cells(iRow, iCol).Font.Bold=True
objSpreadsheet.Cells(iRow, iCol).Font.Italic=False
objSpreadsheet.Cells(iRow, iCol).Font.Size=10
objSpreadsheet.Cells(iRow, iCol).Halignment=2 '居中
iCol=iCol + 1
Next 'objField
'Display all of the data
Do While Not objRS.EOF
iRow=iRow + 1
iCol=iColOffset
For Each objField in objRS.Fields
If IsNull(objField.Value) then
objSpreadsheet.Cells(iRow, iCol).Value=""
Else
objSpreadsheet.Cells(iRow, iCol).Value=objField.Value
objSpreadsheet.Columns(iCol).AutoFitColumns
objSpreadsheet.Cells(iRow, iCol).Font.Bold=False
objSpreadsheet.Cells(iRow, iCol).Font.Italic=False
objSpreadsheet.Cells(iRow, iCol).Font.Size=10
End If
iCol=iCol + 1
Next 'objField
objRS.MoveNext
Loop
End Sub
Function SaveWorksheet(strFileName)
'Save the worksheet to a specified filename
On Error Resume Next
Call objSpreadsheet.ActiveSheet.Export(strFileName, 0)
SaveWorksheet=(Err.Number=0)
End Function
End Class

Dim objRS
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.Open "SELECT * FROM customer",conn,1,1
Dim SaveName
SaveName=Request.Cookies("savename")("name")
Dim objExcel
Dim ExcelPath
ExcelPath="Excel" & SaveName & ".xls"
Set objExcel=New ExcelGen
objExcel.RowOffset=1
objExcel.ColumnOffset=1
objExcel.GenerateWorksheet(objRS)
If objExcel.SaveWorksheet(Server.MapPath(ExcelPath)) then
%>
<html><body bgcolor='gainsboro' text='#000000'>已保存为Excel文件.

<a href='" & server.URLEncode(ExcelPath) & "'>下载</a>
<%
Else
Response.Write "在保存过程中有错误!"
End If
Set objExcel=Nothing
objRS.Close
Set objRS=Nothing
%>
导出的时候有错误
请大家帮帮忙

ki88 2005-03-24
  • 打赏
  • 举报
回复
那应该是在注册的界面才用校验码,为什么许多网站在登陆的时候也要求输入校验码呢?
hbhbhbhbhb1021 2005-03-24
  • 打赏
  • 举报
回复
校验码是为了安全,字符串可以截取,而图片不容易获得图片上的字
建议你参考竹竹验证码
king2003 2005-03-24
  • 打赏
  • 举报
回复
2.网上这程序多了你自已下一个就成了
king2003 2005-03-24
  • 打赏
  • 举报
回复
1.为了防止程序自动注册

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧