user1583647
user1583647

Reputation: 1245

Input to console application in C#

I created a dll file for my matlab program. I integrated it into C# console application now I have to call this console application from php. The user selects an image whose imagepath should be passed as input in the C# console application.

I checked the console application my defining an image path and it works fine how can I program it to accept input from php aplication so that I can call exec(exepath imgpath)in php. I have to pass the image path to the matlab dll file too. My Console application is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using shoesddl;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;


namespace shoes_describe
{
    class Program
    {
        static void Main(string[] args)
        {
            shoesddl.shoes_describe obj = new shoesddl.shoes_describe();

            MWArray img= "C:/Users/adithi.a/Desktop/dressimages/T1k5aHXjNqXXc4MOI3_050416.jpg";
            obj.shoes(img);
        }
    }    
}

I need the imgpath i.e img in the above program from php. How can I achieve it?

Upvotes: 0

Views: 836

Answers (1)

Habib
Habib

Reputation: 223257

use Command Line Parameters. Your method is accepting parameters in string[] args. You can pass the image path alongwith the exe name, from your PHP code.

> exepath imgpath

That imagepath would available at args[0]

Upvotes: 3

Related Questions