如何在WinForms exe中合并外部文件

时间:2016-08-25 05:47:35

标签: c# .net winforms

我正在使用winforms设计脚本生成器。范围是生成一些更新/插入查询。我的项目中的更新/插入查询模板位于<input *ngFor="let l of myList" [(ngModel)]="l.name" name="{{l.id}}" /> <input *ngFor="let o of outlets" [(ngModel)]="o.outletName" name="{{o.id}}" /> 格式的文件夹中。

.text

它在我的机器中就像魅力一样。但是,当我提取.exe并在另一台机器上运行时,我收到的错误如text = File.ReadAllText(@"\Visual Studio 2013\Projects\MigrationScript\MigrationScript\Scripts\Schema_OWNER.SYS_PARAMS.txt"); text = text.Replace(Constants.LOWER_VER, lowerversion) .Replace(Constants.CURRENT_VER, currentversion); System.IO.Directory.CreateDirectory(string.Format(Constants.DIRECTORY_CCB_SEED_OWNER, releaseVal)); File.WriteAllText(string.Format(Constants.DIRECTORY_CCBOWNER_SYS_PARAMS, releaseVal), text);

如何将项目中的外部文件包含到我的.exe中,以便我可以在任何机器上运行?相信我解释了我的问题。如果没有,请回复我。

1 个答案:

答案 0 :(得分:0)

System.IO.DirectoryNotFoundException: Could not find a part of the path明确指出无法从放置和运行.exe的系统访问路径。确定无论您提供的路径是什么,都应该从您的.exe应该执行的系统中访问。

相关问题