如何命名当前项目文件夹中的文件夹路径? [英] How to name a pathway of a folder within a current project folder?

查看:184
本文介绍了如何命名当前项目文件夹中的文件夹路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我目前正在使用Visual Studio 2008,C#,Windows窗体应用程序来开发程序.

我在我的项目文件夹中存储了一个图像文件夹.
当我的程序运行时,它将从文件夹中加载图像.

问题是,如果我将整个项目文件夹复制到另一台计算机.
我将不得不再次在程序中重置文件夹的路径.

因此,我想知道,是否有一种程序可以在项目文件夹中找到该文件夹​​,而不管该文件夹存储在哪里?

Hi all,

I''m currently working on a program using Visual Studio 2008, C#, windows form application.

I stored a folder of images in my project folder.
When my program works, it will load the images from the folder.

The problem is, if i copy the whole project folder to another computer.
I''ll have to reset the pathway of the folder in the program again.

So, I''m wondering, if there is a way for the program to locate the folder within the project folder, regardless of where the folder is stored?

推荐答案

您可以使用此变量获取应用程序目录
you can use this variable to get the application directory
System.Windows.Forms.Application.StartupPath


这篇关于如何命名当前项目文件夹中的文件夹路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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