如何使用ASP.NET(服务器端)ondemand编译EXE文件 [英] How to Compile an EXE file with ASP.NET (server side) ondemand

查看:105
本文介绍了如何使用ASP.NET(服务器端)ondemand编译EXE文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。我看到一个网站( http://www.torrent2exe.com [ ^ ])将torrent文件转换为可执行文件,无需bitTorrent客户端App即可下载。它是如何工作的我怎么能在ASP.NET中做到这一点?



我想上传一个XML文件然后处理该文件并在ASP中的那个xml文件上生成一个可执行文件。我该怎么办?



请帮帮我



谢谢高级



mohammad

解决方案

您可以动态构建.NET源代码并在服务器端编译它而不会出现问题

为此你可以使用 CodeDomProvider 类之一示例 CSharpCodeProvider VBCodeProvider 填写 CompilerParameters 结构并调用CompileAssemblyFromSource

 _ codeProvider.CompileAssemblyFromSource(compilerParams,sCode); 



这可能会有所帮助:

http://stackoverflow.com/questions/14338738/slow-dynamic-compilation-with-csharpcodeprovider [ ^ ]



你可以在exe文件中签名的另一种方式是将该签名附加到exe并在附加其他数据(例如torrent信息)之后,一旦exe开始你打开该exe用于阅读找到签名并在读取私有之后您的程序中的exe信息和使用信息。



Maxim。


hi . i saw a website (http://www.torrent2exe.com[^])that converts torrent file to an Executable file to download without bitTorrent client App. how does it work & how can i do that in ASP.NET ?

i want to upload an XML file then process that file and generate an executable file base on that xml file in ASP . what should i do?

please help me

Thanks in Advanced

mohammad

解决方案

You can build the .NET source code dynamically and compile it on server side without problems
For that you can use one of CodeDomProvider classes example CSharpCodeProvider or VBCodeProvider fill the CompilerParameters structure and call CompileAssemblyFromSource

_codeProvider.CompileAssemblyFromSource(compilerParams, sCode);


This may helps:
http://stackoverflow.com/questions/14338738/slow-dynamic-compilation-with-csharpcodeprovider[^]

Another way you can have signature in a exe file append that signature to exe and after append additional data (example torrent info) and once exe starting you open that exe for reading find the signature and after read you private information for your exe and use that inside your program.

Maxim.


这篇关于如何使用ASP.NET(服务器端)ondemand编译EXE文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆