<%
Dim strScriptName
Dim strInputText
strScriptName = Request.ServerVariables("URL")
strInputText = Request.Form("txtWordCount")
If strInputText = "" Then
strInputText = "Yazınızı buraya yazın!"
Else
' Echo out the input:
Response.Write "Sonuç:<br />" & vbCrLf
Response.Write "<pre>"
Response.Write Server.HTMLEncode(strInputText)
Response.Write "</pre>" & vbCrLf
Response.Write "<p>Toplam <b>" _
& GetWordCount(strInputText) _
& "</b> kelime ve <b>" _
& GetCharCount(strInputText) _
& "</b> karakter var.</p><br />" & vbCrLf
End If
Function GetWordCount(strInput)
Dim strTemp
strTemp = Replace(strInput, vbTab, " ")
strTemp = Replace(strTemp, vbCr, " ")
strTemp = Replace(strTemp, vbLf, " ")
strTemp = Trim(strTemp)
Do While InStr(1, strTemp, " ", 1) <> 0
strTemp = Replace(strTemp, " ", " ")
Loop
GetWordCount = UBound(Split(strTemp, " ", -1, 1)) + 1
End Function ' GetWordCount
Function GetCharCount(strInput)
GetCharCount = Len(strInput)
End Function ' GetCharCount
%>
<p>Bir Yazı Yazın:</p>
<form action="<%= strScriptName %>" method="post">
<textarea name="txtWordCount" cols="40" rows="5"
><%= Server.HTMLEncode(strInputText) %></textarea>
<br />
<input type="submit">
</form>