使用项目文件夹中的文件 [英] using files in project folders

查看:71
本文介绍了使用项目文件夹中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我的解决方案中有一个名为books的文件夹。在这个文件夹中,我添加了一些txt文件,例如:UserManual.txt。现在我想使用这个文件,但我不知道如何导航到它。在调试模式下,所有文件都在适当的文件夹bin \debug \books中。

请帮忙。

Hello,

I have folder in my solution called "books". In this folder I have added some txt files, for example: UserManual.txt. Now I want to use this file, but i don''t know how to navigate to it. In debug mode all files are in proper folder bin\debug\books.
Please help.

推荐答案

如果你这样做的话: -



if you do something like :-

System.Windows.Forms.Application.ExecutablePath.ToString()





iirc,你得到exe的完整路径/名称 - 在你的情况下如果程序是''program.exe''应该是



... \ bin\debug\program.exe



所以如果你剥掉''program.exe' ',并将剩下的''书''结合起来,这将是正确的文件夹



(其中......可能代表C:\ path \)< br $> b $ b

''g''



iirc, you get the full path/name of the exe - in your case if the program was ''program.exe'' that should be

...\bin\debug\program.exe

so if you strip off the ''program.exe'', and combine whats left with ''books'' that would be the correct folder

(where ... may represent C:\path\)

''g''


这篇关于使用项目文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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