广东初二会考成绩:C#,怎样得到本文件当前所在路径?

来源:百度文库 编辑:中科新闻网 时间:2024/05/14 08:49:56
谢谢!

private void button1_Click(object sender, System.EventArgs e)
{
string strPath = Application.StartupPath;
textBox1.Text = strPath ;
}

生成后的exe文件在什么目录,strPath就是那个目录名

WinForm:同上;
WebForm:Server.MapPath("FileName");