猿问

在 c# winform 中读取任何文件和打包文件

我有个问题。我有一个文本文件“hello.pdf”我把文件放到项目的资源中并读取文件


string filename = @"C:\Users\vivio\Documents\Visual Studio 2015\Projects\STool\STool\Resources\hello.pdf";

System.Diagnostics.Process.Start(filename);

我有一个问题:如果我想把STool包到STool.exe,然后把这个包安装在(D:)盘中,那么我想我不会读取文件hello.pdf,因为在我设置的代码中pathfile是"C:\Users\vivio\Documents\Visual Studio 2015\Projects\STool\STool\Resources\hello.pdf" Help me to resolve this问题,谢谢大家


互换的青春
浏览 177回答 1
1回答
随时随地看视频慕课网APP
我要回答