Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/04/2011, 11:38
Avatar de stramin
stramin
 
Fecha de Ingreso: marzo-2008
Ubicación: Cubil felino
Mensajes: 1.652
Antigüedad: 16 años, 1 mes
Puntos: 336
Respuesta: Enviar variables de PHP a C#

el código PHP esta bien, pero no te servirá el retorno de valor, si quieres lo sacas:

$resultado = system("programac.exe $parametro");

en cuanto a como tomar el arreglo en C# en el enlace que te dí sale como hacerlo:



Código C:
Ver original
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.     if (args == null)
  8.     {
  9.         Console.WriteLine("args is null"); // Check for null array
  10.     }
  11.     else
  12.     {
  13.         Console.Write("args length is ");
  14.         Console.WriteLine(args.Length); // Write array length
  15.         for (int i = 0; i < args.Length; i++) // Loop through array
  16.         {
  17.         string argument = args[i];
  18.         Console.Write("args index ");
  19.         Console.Write(i); // Write index
  20.         Console.Write(" is [");
  21.         Console.Write(argument); // Write string
  22.         Console.WriteLine("]");
  23.         }
  24.     }
  25.     Console.ReadLine();
  26.     }
  27. }

con ese código obtienes el primer parámetro como args[0], el segundo como args[1], el tercero args[2], etc.