Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. call exe file in vb.net

call exe file in vb.net

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpalgorithmssecurity
11 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vishnumoorthy
    wrote on last edited by
    #1

    i need to run a encryption and decryption algorithm which is written in c language and call the exe file in vb.net and show the output in form window.

    P P R J 4 Replies Last reply
    0
    • V vishnumoorthy

      i need to run a encryption and decryption algorithm which is written in c language and call the exe file in vb.net and show the output in form window.

      P Offline
      P Offline
      Pradeep Shukla 0
      wrote on last edited by
      #2

      You need to use DLLImport to use the encryption dll to make your program work in .NET. Here is an old article posted on CP: Creating and Calling C Function DLL from .NET[^] Hope it helps.

      P P 2 Replies Last reply
      0
      • P Pradeep Shukla 0

        You need to use DLLImport to use the encryption dll to make your program work in .NET. Here is an old article posted on CP: Creating and Calling C Function DLL from .NET[^] Hope it helps.

        P Offline
        P Offline
        Pravin Patil Mumbai
        wrote on last edited by
        #3

        Good link...

        I quit being afraid when my first venture failed and the sky didn't fall down.

        P 1 Reply Last reply
        0
        • V vishnumoorthy

          i need to run a encryption and decryption algorithm which is written in c language and call the exe file in vb.net and show the output in form window.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Perhaps this[^] might be of use? (At least the concepts involved might be what you want.)

          1 Reply Last reply
          0
          • P Pravin Patil Mumbai

            Good link...

            I quit being afraid when my first venture failed and the sky didn't fall down.

            P Offline
            P Offline
            Pradeep Shukla 0
            wrote on last edited by
            #5

            you gave a -ive vote... :(

            P 1 Reply Last reply
            0
            • P Pradeep Shukla 0

              you gave a -ive vote... :(

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              prdshukla wrote:

              you gave a -ive vote... :(

              How do you know it was him? It could have been anybody.

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

              P 1 Reply Last reply
              0
              • P Pete OHanlon

                prdshukla wrote:

                you gave a -ive vote... :(

                How do you know it was him? It could have been anybody.

                Forgive your enemies - it messes with their heads

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                P Offline
                P Offline
                Pradeep Shukla 0
                wrote on last edited by
                #7

                yeah..you are right...but may be by mistake he may have done it.. :) The rating process is not very intuitive...

                P 1 Reply Last reply
                0
                • P Pradeep Shukla 0

                  yeah..you are right...but may be by mistake he may have done it.. :) The rating process is not very intuitive...

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  How can Good Answer, Bad Answer not be intuitive? It's hard to see how it could be any easier. BTW - it looks like it was two people who didn't like your answer.

                  Forgive your enemies - it messes with their heads

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  1 Reply Last reply
                  0
                  • P Pradeep Shukla 0

                    You need to use DLLImport to use the encryption dll to make your program work in .NET. Here is an old article posted on CP: Creating and Calling C Function DLL from .NET[^] Hope it helps.

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    You may have received the 1s because he says it's an EXE, not a DLL.

                    1 Reply Last reply
                    0
                    • V vishnumoorthy

                      i need to run a encryption and decryption algorithm which is written in c language and call the exe file in vb.net and show the output in form window.

                      R Offline
                      R Offline
                      Rakesh Meel
                      wrote on last edited by
                      #10

                      <DllImport("E:\Temp\simple.dll", CallingConvention:="CallingConvention.Cdecl)"> _
                      Private Shared Sub ReturnInParam(ByRef Stan As Integer, _
                      ByRef Message As String)
                      End Sub

                      Private Sub Button1_Click(ByVal sender As System.Object, _
                      ByVal e As System.EventArgs) Handles Button1.Click
                      Dim Num As Integer = 8
                      Dim Message As String = "Harun"
                      ReturnInParam(Num, Message)
                      MessageBox.Show(Message)
                      End Sub

                      1 Reply Last reply
                      0
                      • V vishnumoorthy

                        i need to run a encryption and decryption algorithm which is written in c language and call the exe file in vb.net and show the output in form window.

                        J Offline
                        J Offline
                        jkirkerx
                        wrote on last edited by
                        #11

                        You can run the exe in the shell, but I'm not sure about the cmd window. I didnt need it, but thi scode will scrape the hidden cmd box for the shel output, in whichyou can regex the return values.

                        Private Function Shell_Exceute_FLV(ByVal Parameters_FFMpeg As String) As String

                           Dim Context As HttpContext = HttpContext.Current
                           Dim SB\_FFMpeg As StringBuilder = New StringBuilder
                        
                           Try
                               Dim Results As String = Nothing
                               Dim ffmpeg As New Process()
                               Dim ffmpeg\_StartInfo As New ProcessStartInfo(Path\_FFMPEG, Parameters\_FFMpeg)
                        
                               ffmpeg\_StartInfo.UseShellExecute = False
                               ffmpeg\_StartInfo.RedirectStandardError = True
                               ffmpeg\_StartInfo.RedirectStandardOutput = True
                               ffmpeg.StartInfo = ffmpeg\_StartInfo
                               ffmpeg.Start()
                        
                               Dim ffmpeg\_StreamReader As IO.StreamReader = ffmpeg.StandardError
                               SB\_FFMpeg = New StringBuilder()
                        
                               SB\_FFMpeg.Append(ffmpeg\_StreamReader.ReadToEnd().ToString())
                        
                               Do While Not ffmpeg.WaitForExit(1000)
                                   SB\_FFMpeg.Append(ffmpeg\_StreamReader.ReadToEnd().ToString())
                               Loop
                        
                               If ffmpeg.ExitCode = 0 Then
                                   ffmpeg.Close()
                                   If Not ffmpeg\_StreamReader Is Nothing Then
                                       ffmpeg\_StreamReader.Close()
                                   End If
                               Else
                                   ffmpeg.Close()
                                   If Not ffmpeg\_StreamReader Is Nothing Then
                                       ffmpeg\_StreamReader.Close()
                                   End If
                               End If
                        
                               ffmpeg.Close()
                               ffmpeg.Dispose()
                               ffmpeg = Nothing
                        
                           Catch ex As Exception
                        
                           End Try
                        
                           Return SB\_FFMpeg.ToString
                        

                        End Function

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups