home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / dbase64w / dbase64w.exe / dBase64.vbs < prev    next >
Encoding:
Text File  |  1999-02-01  |  1.3 KB  |  46 lines

  1. L_Welcome_MsgBox_Message_Text    = "This script demonstrates DameWare Base64 Encoder/Decoder using the Windows Scripting Host."
  2. L_Welcome_MsgBox_Title_Text      = "DameWare Windows Scripting Host Sample"
  3. CrLf = chr(13) & chr(10)
  4. MyTab = chr(9)
  5.  
  6. Call Welcome()
  7.  
  8. Dim DCtl1
  9. Set DCtl1 = Wscript.CreateObject("DameWare.Base64Ctl.1")
  10.  
  11. Dim strTextToEncode, strEncodedResult, strDecodedResult
  12.  
  13. Call RunIt()
  14.  
  15. MsgBox "String to Encode: " & CrLf & CrLf & _
  16.     strTextToEncode & CrLf & CrLf & CrLf & CrLf & _
  17.     "Encoded Result String: " & CrLf & CrLf & _
  18.     strEncodedResult & CrLf & CrLf & CrLf & CrLf & _
  19.     "Decoded Result String: " & CrLf & CrLf & _
  20.     strDecodedResult
  21.  
  22. Set DCtl1 = Nothing
  23.  
  24. Sub RunIt()
  25.     strTextToEncode = "This is a sample string used to demonstrate the Base64 Encoding and Decoding."
  26.  
  27.     DCtl1.DecodedString = strTextToEncode
  28.     DCtl1.Encode
  29.     strEncodedResult = DCtl1.EncodedString
  30.  
  31.     strDecodedResult = ""
  32.     DCtl1.EncodedString = strEncodedResult
  33.     DCtl1.Decode
  34.     strDecodedResult = DCtl1.DecodedString
  35. End Sub
  36.  
  37. Sub Welcome()
  38.     Dim intDoIt
  39.  
  40.     intDoIt =  MsgBox(L_Welcome_MsgBox_Message_Text, _
  41.                       vbOKCancel + vbInformation,    _
  42.                       L_Welcome_MsgBox_Title_Text )
  43.     If intDoIt = vbCancel Then
  44.         WScript.Quit
  45.     End If
  46. End Sub