ServerDotURLEncode
Used by VB applications that want to lightly (without any additional project references) transform unsafe characters into web-friendly URL Encoded text.
AI
Ringkasan AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Kode Sumber
Function ServerDotURLEncode(strBefore As String) As String
Dim strAfter As String
Dim intLoop As Integer
If Len(strBefore) > 0 Then
For intLoop = 1 To Len(strBefore)
Select Case Asc(Mid(strBefore, intLoop, 1))
Case 48 To 57, 65 To 90, 97 To 122, 46, 45, 95, 42 '0-9, A-Z, a-z . - _ *
strAfter = strAfter & Mid(strBefore, intLoop, 1)
Case 32
strAfter = strAfter & "+"
Case Else
strAfter = strAfter & "%" & Right("0" & Hex(Asc(Mid(strBefore, intLoop, 1))), 2)
End Select
Next
End If
ServerDotURLEncode = strAfter
End Function
Private Sub Text1_Change()
Text2 = ServerDotURLEncode(Text1)
End Sub
Komentar Asli (3)
Dipulihkan dari Wayback Machine