[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

asp.net - run a batch file from asp.net page and pass paramters/ or ping from vb.net

I have a asp.net page that I need to pass parameters to a batch file and run periodically...

or..

can I run a ping command from my vb.net page and capture the results?
0
GlobaLevel
Asked:
GlobaLevel
1 Solution
 
JosephEricDavisCommented:
Here is an example of how to do it in C#.

http://www.aspnettutorials.com/tutorials/network/net-ping-aspnet2-csharp.aspx

Should be pretty easy to transpose it into VB.net as the class libraries are pretty much the same.
0
 
Ron MalmsteadInformation Services ManagerCommented:
Yes.

        Dim consoleApp As New Process
        With consoleApp
            .StartInfo.Arguments = "www.google.com"
            .StartInfo.UseShellExecute = False
            .StartInfo.RedirectStandardOutput = True
            .StartInfo.FileName = "ping.exe"
            .Start()
            .WaitForExit()
        End With

        Dim output As String = consoleApp.StandardOutput.ReadToEnd()
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now