Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
|
Binary to URL Encoding
ASP Script to convert from binary to URL encoding. This sample code creates a binary byte array and creates a URL-encoded string. <html>
<body>
<%
set crypt = Server.CreateObject("Chilkat.Crypt2")
crypt.UnlockComponent "anything"
crypt.CryptAlgorithm = "none"
' Encode the output in a URL-encoded string.
crypt.EncodingMode = "url"
' Create a byte array containing 41 bytes.
dim bData(40)
for i = 40 to 80
bData(i-40) = CByte(i)
next
' The output will be:
' %28%29%2A%2B%2C%2D%2E%2F0123456789%3A%3B%3C%3D%3E%3F%40ABCDEFGHIJKLMNOP
' EncryptBytesENC accepts a binary byte array and returns an URL encoded string.
urlEncoded = crypt.EncryptBytesENC(bData)
Response.Write "<p>" + urlEncoded + "</p>"
%>
</body>
</html>
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.