PDA

View Full Version : ساخت برنامه ای که خروجی exe داشته باشه



*unos*
شنبه 31 شهریور 1386, 08:15 صبح
ساخت برنامه ای که خروجی exe داشته باشه یعنی یه بچه کامپایلر:چشمک:

PC2st
شنبه 31 شهریور 1386, 12:11 عصر
استفاده از سی++ برای ساخت بچه کامپایلر :لبخند:

اگر صرفا میخوای یک برنامه سی شارپ رو از طریق برنامه کامپایل کنی، میتونی سورس برنامه رو بصورت متن در یک فایل متنی بنویسی و اون فایل رو (بصورت پارامتر) برای کامپایلر سی شارپ (csc.exe) مشخص کنی و این کارها رو از طریق برنامتون انجام بدید.

sinpin
شنبه 18 اسفند 1386, 11:44 صبح
ساخت برنامه ای که خروجی exe داشته باشه یعنی یه بچه کامپایلر:چشمک:
باید از System.CodeDom.Compiler استفاده کنید. آقای ساچاباربر یک نمونه خوب توی وبلاگش داره :

The other day I was discussing code generation with a collegue and he was discussing a hyperthetical siuation where it would be possible to create source code at runtime and even compile it to create apps at runtime. Now I didnt know much about this, but I decided to have a little exploratory look into this. As ever .NET amazed me (again) and had 2 interesting namespaces to do this.
System.CodeDom : Which allows the generation of a CodeCompileUnit which can be then generated into a source code file for any .NET language
System.CodeDom.Compiler : Is able to create a Assembly/Exe at runtime from a source code file.I have written a small demo application and an accompanying article about this over at www.codeproject.com (http://www.codeproject.com), this is available right here (http://www.codeproject.com/KB/cs/CodeDomCompile.aspx), if you are interested.
The application creates a simple source code file and compiles it into an Exe and runs it, all at runtime. Cool!
بنقل از: http://sachabarber.net/?p=135
لینک دانلود نمونه برنامه : http://www.codeproject.com/KB/cs/CodeDomCompile.aspx