Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Return Value from c# exe
Message
 
À
01/04/2014 08:51:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01597172
Message ID:
01598109
Vues:
90
Thanks Gregory for your reply
tregards,
Gerard


>>Hi.
>>I have C# Console EXe whcih returns an integer in Main()
>>I want to Run the App from within Foxpro and get the Vlaue returned from the C# .exe
>>Anybody have any idea how this can be done?
>>My preference would be not to start ourputting the result to another file if its possibel to directly access the return value
>>
>>Tia
>>Gerard
>
>If your exe uses Console.WriteLine() to output the result to the stdout
>Use WScript.Shell
>
>Sample: a dir command
>
>
>	WshShell = CreateObject("WScript.Shell")
>	&&WshShell.CurrentDirectory ='D:\'
>	oExec    = WshShell.Exec("%comspec% /c dir")
>
>	do while !m.oExec.StdOut.AtEndOfStream
>		x = oExec.StdOut.ReadLine()
>		?'stdout ', x 
>	enddo
>	
>	do while !m.oExec.StdErr.AtEndOfStream
>		x = oExec.StdErr.ReadLine()
>		?'StdErr', x 
>	enddo
>	
>	
>	&& ?oExec.Terminate()
>	?oExec.ExitCode
>
>&& http://msdn.microsoft.com/en-us/library/af9z0a1t(v=vs.84).aspx
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform