从C#文件中执行C ++/C代码 [英] Executing C++/C Codes from a file in C#
本文介绍了从C#文件中执行C ++/C代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否可以从C#文件中执行C ++或C代码.
I would like to know if it is possible to execute C++ or C codes from a file in C#.
很显然,代码中不会包含dll或exe文件,因为它们只是单个文本文件.
Obviously, there will be no dll or exe files from the codes since they are just single text files.
如果不可能,为什么?
如果可能,我需要了解什么?
If it is possible, what are the things I need to know?
谢谢
推荐答案
不能用c#编写c/c ++代码.
Is imposible write c/c++ code with c# .
首先,.net环境,运行时,编译器完全不同.
First ,.net enviroment,runtime, compiler is totally diffent.
C/C ++是非托管代码,C#是托管代码.
C/C++ is Unmanaged code, C# is managed code .
在.net环境下编写非托管代码的一种方法是
Just one way you can write your Unmanaged code at .net enviroment is
http://blogs.msdn.com/b/borisj/archive /2006/09/28/769708.aspx
这篇关于从C#文件中执行C ++/C代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文