재우니의 블로그

http://nextstep.co.kr/5 발췌
 



Base64 Encoding Library 2.04

Properties:
  • LastCount As Double. Returns the amount of time that the last operation took, in seconds.

Methods:

  • Encode (strDatos As String) As String. Encodes data passed in strDatos and returns the result in a String var.
  • EncodeArr (arrDatos() As Byte) As String. Encodes data passed in the array Datos and returns the result in a String var.
  • EncodeArrArr (arrDatos() As Byte). This method will take data to encode from arrData() and will return the encoded data in the same array. It's the fastest one.
  • EncodeFromFile (strPath As String) As String. Encodes the file specified in strPath and returns the result in a String var.
  • Decode (strDatos As String) As String. Decodes data passed in strDatos and returns the result in a String var.
  • DecodeArr (strDatos As String). Decodes data passed in strDatos and returns the result in an array.
  • DecodeArrArr (arrDatos() As Byte). This method will take data to decode in arrDatos() and will return the decoded data in the same array. It's the fastest one.
  • DecodeToFile (strDatos As String, strPath as String). Decodes data passed in strDatos and saves the result to the file given in strPath. If another file exists with the same name, it will try to overwrite it.

사용방법

1. 레지스트리 등록 (시작->실행->cmd 하신후 프럼프트에서 regsvr32 c:\base64.dll)

2. IIS재시작

* 인코딩
Set objEncode = Server.CreateObject("Base64Lib.Base64")
strEncodeData = objEncode.Encode(strContents)
Set objEncode = Nothing
Response.Write strEncodeData

* 디코딩
Set objDecode = Server.CreateObject("Base64Lib.Base64")
strDecodeData = objDecode.Decode(strContents)
Set objDecode = Nothing
Response.Write strDecodeData


※ 한글지원도 잘 됩니다.
  삭제시에는 regsvr32 -u c:\base64.dll 하시면 됩니다.