Windows Vista Forums

can I urlencode/urldecode via vbscript in an HTA?
  1. #1


    James Guest

    can I urlencode/urldecode via vbscript in an HTA?

    can I urlencode/urldecode via vbscript in an HTA?



    I'm using the RC4-like encryption algorithm from:
    http://www.4guysfromrolla.com/webtech/010100-1.shtml

    I needed a way to encrypt/decrypt some info from a wsh/vbscript... the
    encrypted info will be stored in a database and later displayed from a web
    app using asp.net/c#. The asp.net/c# part will be no problem... but I am
    also creating a simple HTA utility for quickly encrypting/decrypting data
    and ran into a problem that I think my be fixed by url encoding.... the
    encrypted text does not display accurately in the textbox (input type=text)
    in the hta and so results are inaccurate when that encrypted text is
    subsequently used to decrypt. I know the algorithm works because If I just
    store all the parts in variables the encrypt/decrypt works, its only when I
    try to put the encrypted text into a text box for viewing and then
    subsequently decrypting again that the problem occurs... no error, just
    inaccurate results. If you happen to be familiar with this algorithm from
    link above you can see what I mean by tring to encrypt/decrypt 'test'
    (without quotes) using key '666'(without quotes).... if you put encrypted
    result into a text box and then use the value of that textbox to decrypt
    again it is wrong...

    anyone?


      My System SpecsSystem Spec

  2. #2


    Gilles LAURENT [MVP] Guest

    RE: can I urlencode/urldecode via vbscript in an HTA?

    Hello James,

    For example :

    ' constructs a string with binary (non printable) chars
    For i=0 To 20: s=s & Chr(i): Next

    ' encodes the string
    sEncoded=Escape(s)
    MsgBox sEncoded

    ' decodes the previously encoded string
    sDecoded=Unescape(sEncoded)

    Hope this helps.

    --
    Gilles LAURENT
    MVP Windows Server - Admin Frameworks
    http://glsft.free.fr


      My System SpecsSystem Spec

  3. #3


    James Guest

    Re: can I urlencode/urldecode via vbscript in an HTA?

    beautiful, thank you!

    "Gilles LAURENT [MVP]" <glsft@xxxxxx> wrote in message
    news:4153CAFC-E08D-40BB-B658-48BD01B782AC@xxxxxx

    > Hello James,
    >
    > For example :
    >
    > ' constructs a string with binary (non printable) chars
    > For i=0 To 20: s=s & Chr(i): Next
    >
    > ' encodes the string
    > sEncoded=Escape(s)
    > MsgBox sEncoded
    >
    > ' decodes the previously encoded string
    > sDecoded=Unescape(sEncoded)
    >
    > Hope this helps.
    >
    > --
    > Gilles LAURENT
    > MVP Windows Server - Admin Frameworks
    > http://glsft.free.fr
    >

      My System SpecsSystem Spec

can I urlencode/urldecode via vbscript in an HTA? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
are VBscript on Windows server 2003 and VBscript on WS2008 compatible? Francois Lafont VB Script 9 26 Apr 2010
Can a vbscript identify the program/process that called a vbscript MarceepooNu VB Script 15 16 Mar 2010
CSS and VBscript RICK VB Script 1 23 Jan 2009
Where is VBscript now? Brent Morehouse VB Script 2 12 Dec 2008
How to do No hang up VBScript (nohup for VBScript) gimme_this_gimme_that VB Script 3 28 Oct 2008