Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent to shellexecute in .net
Message
 
À
06/03/2009 14:14:25
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01386295
Message ID:
01386758
Vues:
52
>Update: this works as well:
>
>
>           using System.Diagnostics;
>
>           System.Diagnostics.Process p = new Process();
>           p.StartInfo.FileName = "cmd.exe";
>           p.Start();
>
>
>
>
>
>
>Right now I am using this to run another program from an app in .net:
>
>
>       private void button5_Click(object sender, EventArgs e)
>
>        {
>
>           System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo("cmd.exe"); // just an example
>
>           info.UseShellExecute = true;
>
>           info.Verb = "open";
>
>           System.Diagnostics.Process.Start(info);
>
>        }
>
>is there a better way?


I do not know, what is "better", here are a couple of examples from my working applications:

oShell = CreateObject("WScript.Shell")
oShell.Run(FTP_BATFile)

There is also Public Function Shell(...)

Shell(DataSrcDir & "sunmail.cmd " & Session_Err_emailFile & " > " + DataSrcDir + "sunmail_dlrcost.log")


Good Luck
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform