Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2004

Tip: Looking for answers? Try searching our database.

help in visual basic .net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Deepa Yamini S - 25 Jun 2004 23:55 GMT
I have a fortran exe (asos.exe), which outputs a text file in the same
directory as that of the exe. When this exe is invoked individually,
it outputs a text file. I tried to invoke it from .net form, using
shell command / system.dagnostics.process.start, but it writes to the
console and not to the file. In other words my output text file is not
created at all. I want to overcome this problem. My ultimate goal is
to invoke the fortran.exe from VB.net form, and get the result. Can
anyone help me with this code please? thanks in advance.

With smiles,
Deepa Yamini S.
Ken Tucker [MVP] - 27 Jun 2004 19:21 GMT
Hi,
   
    Try this.

       Dim p As New Process

       Dim SI As New ProcessStartInfo

       With SI
           .RedirectStandardOutput = True
           .UseShellExecute = False
           .FileName = "C:\asos.exe"
       End With

       Dim strOut As String

       p = Process.Start(SI)

       strOut = p.StandardOutput.ReadToEnd.ToString

       Trace.WriteLine(strOut)
       p.WaitForExit()

       Dim sw As New System.IO.StreamWriter("C:\MyOutput.txt", False)

       sw.WriteLine(strOut)

       sw.Close()

Ken
--------------------------

> I have a fortran exe (asos.exe), which outputs a text file in the same
> directory as that of the exe. When this exe is invoked individually,
[quoted text clipped - 7 lines]
> With smiles,
> Deepa Yamini S.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.