Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert VB.NET to Javascript

Status
Not open for further replies.

MCas86

Programmer
Mar 31, 2010
4
US
I'm creating an ASP.NET web app. I have some code that I need to run on the clientside. However, the only code I have is being run serverside (VB.NET). Is there anything I can use to convert it to javascript? Or can someone do it for me? It's not much code. Although, I have no idea how difficult it may be. I've attached it in a text file.
 
Unfortunately we have no access to your C: drive so we can't see your file.

If its not too long you may want to post it between [ignore]
Code:
[/ignore] tags right here.

It would also help if you told us what it is you want the code to do client side and why doing it server side is no good.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I'm trying to use 'ClickYes' on the clientside because I'm using Outlook on the client's computer to send email. Before you ask, I'm not using SMTP because its blocked by the company.

Code:
 Private Declare Function RegisterWindowMessage _
            Lib "user32" Alias "RegisterWindowMessageA" _
            (ByVal lpString As String) As Long

    Private Declare Function FindWindow Lib "user32" _
            Alias "FindWindowA" (ByVal lpClassName As String, _
            ByVal lpWindowName As Integer) As Long

    Private Declare Function SendMessage Lib "user32" _
            Alias "SendMessageA" (ByVal hwnd As Long, _
            ByVal wMsg As Long, ByVal wParam As Long, _
            ByVal lParam As Long) As Long

    Public Sub Turn_Auto_Yes_On()
        Try
            Dim wnd As Long
            Dim uClickYes As Long
            Dim Res As Long
            uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
            wnd = FindWindow("EXCLICKYES_WND", 0&)
            Res = SendMessage(wnd, uClickYes, 1, 0)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Public Sub Turn_Off_Auto_Yes()
        Try
            Dim wnd As Long
            Dim uClickYes As Long
            Dim Res As Long
            uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
            wnd = FindWindow("EXCLICKYES_WND", 0&)
            Res = SendMessage(wnd, uClickYes, 0, 0)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
 
Interesting, I'm not familiar with ClickYes, however someone else here may be able to convert this to JS.

Alternatively, maybe converting it to VBscript would be easier and would still be run client side.

You may want to post in forum329 for help.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Alright, Thanks. I'll give it a try. The only reason I was posting here was because I use JS to send my emails.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top