string exePath = Application.ExecutablePath;

解决方案 »

  1.   

    上面的都会带上Exe程序的名字,下面这个只得到所在的路径:
    Application.StartupPath;
      

  2.   

    又见到  hbxtlhx能否看看我的问题
    http://community.csdn.net/Expert/topic/3495/3495956.xml?temp=.6612512
      

  3.   

    /**//// <summary>
            /// 获取Assembly的运行路径
            /// </summary>
            /// <returns></returns>
            private string GetAssemblyPath()
            {
                string _CodeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase ;            _CodeBase = _CodeBase.Substring(8,_CodeBase.Length - 8);    // 8是 file:// 的长度            string[] arrSection = _CodeBase.Split(new char[]{'/'});
                
                string _FolderPath = "";
                for(int i=0;i<arrSection.Length-1;i++) 
                {
                    _FolderPath += arrSection[i] + "/";
                }            return _FolderPath;
            }