본문으로 바로가기
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 하시면 됩니다.

댓글을 달아 주세요

  1. Peng's 2012.01.03 15:16 신고

    strEncodeData = objEncode.Encode("테스트") 이거는 되는데요
    strEncodeData = objEncode.Encode(pointApichk_data) 이거는 왜 안될까요 ㅋㅋㅋ

    • 지나가다 봅니다 2012.07.06 12:02 신고

      인코딩 텍스트를 변수로 넣으니까 안되네요

      그럴때는 execute 문으로 감싸서 이렇게 해보세요

      execute(" objEncode.Encode("""& strContents &""") ")