플밍_ASP
ASP - 특정 페이지 소스 출력 하는 Function
잠수콩
2009. 2. 13. 11:00
function View_Source(Target_URL)
'//파일오브젝트 생성
Set FSO_Open = Server.CreateObject("Scripting.FileSystemObject")
'//파일 경로지정
Filepath = Server.Mappath(Target_URL)
'//파일 오픈
Set File_Open = FSO_Open.OpenTextFile(Filepath, 1)
'//파일 읽고 변수에 값 넣음
Text_FSO = File_Open.ReadAll
'//닫기
Set File_Open = nothing
Set FSO_Open = nothing
'//ASP 파일에서 사용한 특정 캐릭터를 변환(순서 조심)
Text_FSO = Replace(Text_FSO, "&", "&")
Text_FSO = Replace(Text_FSO, " ", " ")
Text_FSO = Replace(Text_FSO, "<", "<")
Text_FSO = Replace(Text_FSO, ">", ">")
Text_FSO = Replace(Text_FSO, vbCrLf, "<br>")
'//변수를 뿌려준다
View_Source = Text_FSO
end function