아는 것이 좋은 것이다.

[ASP] 배너 카운트 처리 본문

ASP

[ASP] 배너 카운트 처리

start0 2014. 4. 24. 21:55

 

<%

Const ForReading = 1, ForWriting = 2, ForAppending = 8


'개체 선언
Set Fso        = Server.CreateObject("Scripting.FileSystemObject")
Set Fso_Get  = Fso.GetFile(Server.MapPath("/") & "\banner_count.txt")
Set Fso_Str   = Fso_Get.OpenAsTextStream(ForReading, -2)


'불러오기
Num = Int(Num + Fso_Str.ReadLine)


'내용 입력
Set Fso_In = Fso.CreateTextFile(Server.MapPath("/") & "\banner_count.txt", true)
Fso_In.WriteLine(Int(Num) + 1)


'개체 소멸
Fso_Str.Close()
Set Fso_Str  = Nothing
Set Fso_Get = Nothing
Set Fso_In   = Nothing
Set Fso       = Nothing


Response.Write "<script>document.location.href = 'banner.asp';</script>"
Response.End


%>

Comments