更新时间:2023-12-01 15:30:40
如果您使用的是.Net,请使用global.asax并在global.asax文件中的以下文件后面使用以下代码
if you are using .Net use global.asax and use below code in your global.asax code behind file
Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
'' Fires right before the request handler executes
''Files is folder in the file path
If Context.Request.Url.AbsoluteUri.IndexOf("/Files/") > 0 Then
If Context.Request.Url.AbsoluteUri.IndexOf(".doc") > 0 Then
Context.Response.End()
End If
End If
End Sub