The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > General Programming > Visual Basic > VB.NET


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Reply
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 12-29-2007, 06:34 PM
SJP SJP is offline
Novice
Join Date: Dec 2007
Posts: 1
iTrader: (0)
SJP is on a distinguished road
Linking independent programs

Hello everyone. I'm new to this whole thing. Have been programming on my own for some time so I really don't know the formal lingo.

Presently, I'm learning Visual Studio 2005. Quite a jump. Does anyone know how to run a program from the existing program. I used to use the Run command. Found the Application.Run(filename) but I get a blue line when I type in the file name. Thanks.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
  #2 (permalink)  
Old 12-30-2007, 10:58 AM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 317
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
Just launching the app on button1 click:
Code:
 Private Sub Button1_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles Button1.Click
        System.Diagnostics.Process.Start("C:\listfiles.bat")
    End Sub
Heres an example that will launch another application - and wait for it to finish:

Code:
 Private Sub Button2_Click(ByVal sender As Object, _
        ByVal e As System.EventArgs) Handles Button2.Click
        Dim psi As New _
            System.Diagnostics.ProcessStartInfo("C:\listfiles.bat")
        psi.RedirectStandardOutput = True
        psi.WindowStyle = ProcessWindowStyle.Hidden
        psi.UseShellExecute = False
 Dim listFiles As System.Diagnostics.Process
        listFiles = System.Diagnostics.Process.Start(psi)
        Dim myOutput As System.IO.StreamReader _
            = listFiles.StandardOutput
        listFiles.WaitForExit(2000)
        If listFiles.HasExited Then
 Dim output As String = myOutput.ReadToEnd
            Debug.WriteLine(output)
        End If
 End Sub
Reply With Quote
The Following User Says Thank You to ccoonen For This Useful Post:
TeraTask (12-30-2007)
Reply

« VB.NET vs. VB | - »

Thread Tools
Display Modes

   Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 06:32 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50