老生常谈的问题了,C#在指定目录时,路径中要使用 \。直接看实例
using System; namespace OpenFile{ class OpenFile{ static void Main(){ string path = System.Environment.CurrentDirectory; path += "\lib"; System.Console.WriteLine(path); System.Diagnostics.Process.Start("explorer",path); } } }至于为啥用两个 。相信做过编程的人都知道一个 是要将后面的字符转义吧