怎么得到程序文件自身的路径? 用c#实现 我实在没办法了谢谢大侠啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void button1_Click(object sender, System.EventArgs e) { string path = Directory.GetCurrentDirectory(); this.textBox1.Text=path; }//其中的path就是程序当前位置了! 呵呵,补一点!记得引用一下!using System.IO; 呵呵,补一点!记得引用一下!using System.IO; Application.StartupPath——获取启动了应用程序的可执行文件的路径,不包括可执行文件的名称。Environment.CurrentDirectory——获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。Application.ExecutablePath——获取启动了应用程序的可执行文件的路径,包括可执行文件的名称。 我再补充一个System.IO.Directory.GetCurrentDirectory() //获取应用程序的当前工作目录。 通过调用Process.GetCurrentProcess().MainModule.FileName可获得当前执行的exe的文件名。Environment.CurrentDirectoryDirectory.GetCurrentDirectory()AppDomain.CurrentDomain.BaseDirectoryApplication.StartupPathApplication.ExecutablePathAppDomain.CurrentDomain.SetupInformation.ApplicationBase获取当前应用程序所在的路径。http://www.cnblogs.com/xingd/archive/2005/03/21/123152.html(web)的是Server.MapPath("\\CMPdata.mdb") dragonfly001 说得好 顶! 一个对象创建的类,求改进.. 求指点 请教一个图片上传的简单写法 C# TreeView CheckBox 问题! 急!!!!!请高手帮忙!没分了,很不好意思!以后补给!!!!!!! 用C#做一个电子公章谁能帮忙???????? c# 中picturebox控件的Tag属性如何使用? 正则表达式问题 怎样将string类转化为其他类型,例如... 谁能告诉我MSN邮箱pop3服务器的地址? 关于Session丢失的一个问题(太奇怪了),急!!! ComboBox的小问题,大家来看看
{
string path = Directory.GetCurrentDirectory();
this.textBox1.Text=path;
}
//其中的path就是程序当前位置了!
Environment.CurrentDirectory
Directory.GetCurrentDirectory()
AppDomain.CurrentDomain.BaseDirectory
Application.StartupPath
Application.ExecutablePath
AppDomain.CurrentDomain.SetupInformation.ApplicationBase获取当前应用程序所在的路径。
http://www.cnblogs.com/xingd/archive/2005/03/21/123152.html(web)的是Server.MapPath("\\CMPdata.mdb")