原文:
using System;using System.Collections.Generic;using System.Text;using System.IO;namespace Tools{ ////// 使用ILmerge合并Exe、Dll文件的帮助类 /// public class ILmerge { ////// 得到合并Exe、Dll文件的ILmerge语句 /// /// Dll文件目录 /// 原exe文件全路径 /// 要生成的exe文件全路径 ///public static string GetMergeExeCmd(string DllPath,string SourceExeFile,string TargetExeFile) { StringBuilder sb = new StringBuilder(); sb.Append("ILmerge /ndebug /target:winexe /out:"); sb.Append(TargetExeFile); sb.Append(" /log "); sb.Append(SourceExeFile); string []dllFiles = Directory.GetFiles(@DllPath,"*.dll"); foreach (string dllFile in dllFiles) { sb.Append(" " + dllFile); } return sb.ToString(); } /// /// 得到合并Dll文件的ILmerge语句 /// /// Dll文件目录 /// 要生成的Dll文件全路径 ///public static string GetMergeDllCmd(string DllPath, string TargetDllFile) { StringBuilder sb = new StringBuilder(); sb.Append("ILmerge /ndebug /target:dll /out:"); sb.Append(TargetDllFile); sb.Append(" /log "); string[] dllFiles = Directory.GetFiles(@DllPath,"*.dll"); foreach (string dllFile in dllFiles) { sb.Append(" " + dllFile); } return sb.ToString(); } }}
posted on 2014-02-24 00:50 阅读( ...) 评论( ...)