开发者

get the path of the project in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this quest开发者_运维技巧ion so that it can be reopened, visit the help center. Closed 11 years ago.

how do I get the path of the project? i want to assign a string with the path of the folder of the project. lets say, the folder of my project (in C#) is E:\projects\something (in folder something, I have the .sln file and all the source codes and also a folder pictures, and in some function I want to assign a string to the path of the project's folder for after it use fhe files in pictures... what I need is a function retorning the path of the project. string s=project_path;


private void button1_Click(object sender, System.EventArgs e)
{
   string path;
   path = System.IO.Path.GetDirectoryName( 
      System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase );
   MessageBox.Show( path );
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜