C#,怎样得到本文件当前所在路径?

谢谢!

第1个回答  推荐于2016-09-02
private void button1_Click(object sender, System.EventArgs e)
{
string strPath = Application.StartupPath;
textBox1.Text = strPath ;
}

生成后的exe文件在什么目录,strPath就是那个目录名本回答被提问者采纳
第2个回答  2005-11-25
WinForm:同上;
WebForm:Server.MapPath("FileName");
相似回答