"i have an application in c++ and have to make the output from it
be read by a program done in C#. I would like to know if it exists
some way to do it?"
Yes, my suggestion is that you do the storage of the output information in a arquivo.txt
.
The following examples are applications made in Console
.
The first example is a c++
that creates and writes the board information into a file .txt
Program C++
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ofstream myfile;
myfile.open ("Placa_Veiculo.txt");
myfile << "ABC-1234";
myfile.close();
return 0;
}
The second will perform the reading of the text file. where so in your program c#
will perform the desired treatment for plate information.
Program in C#
static void Main(string[] args)
{
try
{ // abrir arquivo de texto usando stream reader.
using (StreamReader sr = new StreamReader(@"C:\Users\usuario_do_mal\Desktop\Pasta do meu Projeto C++\Placa_Veiculo.txt"))
{
// Ler arquivo e armazenar a informação da placa
String Leitura_Arquivo = sr.ReadToEnd();
string Placa = Leitura_Arquivo;
}
}
catch (Exception e)
{
Console.WriteLine("Erro :");
Console.WriteLine(e.Message);
}
}
Remember to use the namespace
System.IO.
Obs : Note that a well simplified example, and was made to meet the need for everything that was said up to the moment.
You can consult the sources clicking here and here.
Hello be welcome ! try to add some more details of your application in c++ in the statement, you can start with the code snippet , we have to understand how and made the "exit" of your program. The "output" would be text in a console application ?
– stringnome
Initially the output is done by console, but I wanted it to be otherwise, I do not have much c base++.
– Jeferson Oliveira
How about saving the output to a text file ( .txt ) ? so you can read in a program in C# I believe it would be the easiest way.
– stringnome
but I could make my program in c# check if there is content in that txt?
– Jeferson Oliveira
My real problem is this, I’m trying to develop an application that through a camera identifies the plate of a vehicle and sends this response to my program done in c#, I wanted to do everything in c# but I couldn’t find any tools to help me develop the identification part of the plate in this language, only in c++.
– Jeferson Oliveira
But Opencv for example is possible to integrate with C#
– ederwander
http://answall.com/q/69742/101
– Maniero
Opencv in C#: http://www.emgu.com/wiki/index.php/Main_Page
– Luiz Vieira