Here is a VB.NET version of a C# example that I found to do just that. It’s really simple to do.
<%@ Page Language=”vb” %>
<%@ Import Namespace=”System.Diagnostics” %>
‘‘Get a file name relative to the current Web app.
Dim file As String = Server.MapPath(“Program.exe”)
Dim info As ProcessStartInfo = new ProcessStartInfo(file, “/arguments”)
‘‘Redirect output so we can read it.
info.RedirectStandardOutput = true
‘‘To redirect, we must not use shell execute.
info.UseShellExecute = false
‘‘Create and execute the process.
Dim p As Process = Process.Start(info) p.Start()
‘‘Send whatever was returned through the output to the client.
Response.Write(Replace(Replace(p.StandardOutput.ReadToEnd(), vbCrLf, “ “), “ “, “ “))
This blog post is licensed under the Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the blog post content. All other content on this website is not licensed under Creative Commons licensing.