添加cookie验证,如:'通用事件头,用于发送已经存在的常见文件
Dim fl As String = "d:\web\" & e.path
If filesys.FileExists(fl)
Dim userid As String = e.Cookies("userid")
If userid Is Nothing OrElse 其他验证 = False Then
e.WriteFile("你没有权限")
Return '这里必须返回
End If
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".xls"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
又如:
Select Case e.path
Case "ckd.xls"
Dim userid As String = e.Cookies("userid")
If userid Is Nothing OrElse 其他验证 = False Then
e.WriteFile("你没有权限")
Return '这里必须返回
End If
Dim fl As String = "d:\web\" & e.path
If filesys.FileExists(fl)
e.WriteFile(fl)
End If
End Select
[此贴子已经被作者于2019/4/6 9:32:49编辑过]