이 기사는 주로 검색 엔진 스파이더가 액세스하는 것을 금지하는 코드를 소개합니다.
이 코드는 ASP 페이지에 액세스 할 수 없도록 공통 검색 엔진을 제어 할 수 있으며이 코드를 각 ASP 페이지에 포함시켜야합니다.
- <%
- functionissPider ()
- 디미 에이전트 시어 레이
- 에이전트 = 에이전트 : & lcase (request.servervariables (http_user_agent))
- Searray = 어레이 (Googlebot, Baiduspider, Sogouspider, Yahoo, Sosospider)
- isspider = false
- fori = 0toubund (Searray)
- if (instr (agent, searray (i))> 0) whatisspider = true
- 다음
- 최종 기능 장애
- functionfromse ()
- Dimurlrefer, Searay, i
- urlrefer = 참조 : & lcase (request.servervariables (http_referer))
- Fromse = false
- ifurlrefer = thenfromse = false
- Searray = 배열 (Google, Baidu, Sogou, Yahoo, Soso)
- fori = 0toubund (Searray)
- if (instr (urlrefer, searray (i))> 0) 그런 다음 true에서옵니다
- 다음
- 최종 기능 장애
- if (isspider ()) 그러면
- Dimmyfso, FileUrl, filecon, myfile
- fileurl = server.mappath (images/bg01.gif)
- setmyfso = server.createobject (scripting.filesystemobject)
- ifmyfso.fileExists (fileUrl)
- setmyfile = myfso.opentextfile (FileUrl, 1)
- filecon = myfile.readall
- Response.Write (filecon)
- myfile.close
- setmyfile = 아무것도
- setmyfso = 아무것도
- 응답. 엔드
- endif
- endif
- if (fromse ()) 그러면
- response.write (<br/>)
- 응답. 엔드
- 또 다른
- endif
- %>
위는이 기사의 전체 내용입니다. 나는 당신이 그것을 좋아하기를 바랍니다.