Home how do i take this "VBScript" i created using HTML format and make it work in visual studio windows form application?
Reply: 0

how do i take this "VBScript" i created using HTML format and make it work in visual studio windows form application?

Steed
1#
Steed Published in 2017-12-08 00:22:19Z

i am trying take a vbscript out of an html .hta file i created and make it work in visual studio. i realized scripting in html for making an hta is pointless when i can make a better looking gui using visual studio 2017. this line of code is an important part of the program.

<script language="VBScript"> 

    Function Validate(ID)
    On Error Resume Next
    Key = Int(pass.value)
    If (pass.value = "") Then
    X = MsgBox("You have to enter your password..!", 48, "Error")
    Else If (ScriptArea.value = "") Then
    X = MsgBox("Enter the text to encrypt or decrypt!", 48, "ERROR!")
    Else
    Junk = SetTimeOut(KEYS(ID), 1)
    End If
    End If
    End Function
    Function KEYS(ID)
    text = pass.value
    code = 0
    Do Until text = ""
    code = ((Asc(Left(text, 1)))+code)
    text = Replace(text, Left(text, 1), "", "1", "1")
    Loop
    code = code Mod 255
    akey.value = code
    Junk = SetTimeOut(ID, 1)
    End Function
    Function SREncrypt
    Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
    text = ScriptArea.value
    code = ""
    key = Int(akey.value)
    Do Until text = ""
    cnum = Asc(Left(text, 1))
    cnum = (cnum+key) Mod 255
    num = cnum Mod 26
    count = 0
    tst = num
    Do Until tst = cnum
    tst = tst+26
    count = count+1
    Loop
    code = code & Alpha(num) & count
    text = Replace(text, Left(text, 1), "", "1", "1")
    Loop
    ScriptArea.value = code
    End Function
    Function Decrypt
    Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
    text = ScriptArea.value
    code = ""
    key = Int(akey.value)
    Do Until text = ""
    lttr = Left(text, 2)
    num = Asc(Left(lttr, 1))-65
    chk = Right(lttr, 1)
    count = 0
    Do Until count = Int(chk)
    num = num+26
    count = count+1
    Loop
    num = num-key
    Do While num <= 0
    num = num+255
    Loop
    Code = code & Chr(num)
    text = Replace(text, Left(text, 2), "", "1", "1")
    Loop
    ScriptArea.value = code
    End Function
    </script>

<textarea id="ScriptArea" cols="80" rows="15"></textarea></span></td> </tr>

<body bgcolor="white"> <input type="hidden" id="akey"> 
<tr> <td align="center"><span title="Enter your Full message here">

<td color="black" style="font-family: Book Antiqua; font-size:18;"><hr color="black"> Password <span title="Enter your password here">
<input type="password" id="pass"></span>
<span title="Click Here to Encrypt your Message"> 
<input style="width: 170px; height:23px; color: white; background-color: #203040; font-family:Book Antiqua;" type="button" Value="SREncrypt" id="btnenc" onClick="Validate('SREncrypt')" onmouseover="btnenc.style.background='#102030'" onmouseout="btnenc.style.background='#203040'"> </span> 
<span title="Click Here to Decrypt your Message"> 
<input style="width: 170px; height:23px; color: white; background-color: #203040; font-family: Book Antiqua; font-size:13;" type="button" Value="Decrypt" id="btndec" onClick="Validate('Decrypt')" onmouseover="btndec.style.background='#102030'" onmouseout="btndec.style.background='#203040'"> </span></td>
</tr> <tr> <td align="right"><hr color="black">`

-->

the softwares i used that did not work are "coffeecup html editor">"easy html to any script">"vbs to exe"

please help i learned a lot scripting and coding in html and vbscript language but they are not good enough to make a sleek user friendly gui. i need to use visual studio. i made the program work great in hta but it was wonky and ugly. i started rewriting in visual studio and i made great progress in the past 12 hours but i am hitting this road block and im getting tired. hopefully i can either figure it out before i get to sleep or maybe get some great advice from the experts here for when i get back at it tomorrow. thanks for reading.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.322254 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO