ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar
ASP Upload
XML
XMP
Zip Compression

More Examples...
Email Object
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Icon

 

 

 

 

 

 

Convert String to Byte Array Function

ASP function to convert a string to a byte array.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%

'  
' String to byte array conversion function:
Function StringToByteArray(s)
  Dim i, byteArray
  For i=1 To Len(s)
    byteArray = byteArray & ChrB(Asc(Mid(s,i,1)))
  Next
  StringToByteArray = byteArray
End Function

s = "ABCDEFG"

' Convert the string to a byte array.
Dim byteArray
byteArray = StringToByteArray(s)

' Display the length of the byte array
Response.Write CStr(LenB(byteArray)) & "<p>"

' Display the bytes as decimal integers:
Dim d
d = ""
For i = 1 To LenB(byteArray)
    d = d & CStr(AscB(MidB(byteArray, i, 1))) & ","
Next
Response.Write "<p>" & d & "</p>"

' Output: 65,66,67,68,69,70,71,

%>
</body>
</html>

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.