Recommended: Use ASP to protect web pages simply To use the ServerVariables property of the request object, use it to get the value of the environment variable. The syntax used is: Request.ServerVariables(variable), variable represents the name of the environment variable, such as the server host name, web server
' getStrLen
' Get the character length, the length of a Chinese character is calculated as 2
' Parameters:
' str needs to get the string of length
' Return value: integer (length of string)
| The following is the quoted content: Function GetStrLen(str) If IsNull(str) Or str = Then getStrLen = 0 Else Dim i, n, k, chrA k = 0 n = Len(str) For i = 1 Ton chrA = Mid(str, i, 1) If Asc(chrA) >= 0 And Asc(chrA) <= 255 Then k = k 1 Else k = k 2 End If Next getStrLen = k End If End Function |
Share: 28 views on learning ASP and programming 1. Don’t miss any small programming problem that seems simple - they are often not that simple, or can lead to a lot of knowledge points; 2. Being able to use asp does not mean that you can do asp; 3. You can’t learn the asp language by reading asp books; 4.