C#打开其他文件夹中的其他文件

C#打开其他文件夹中的其他文件,c#,C#,因此,我一直在试图弄清楚,如何在程序所在的根文件夹之后打开一个文件夹。我要找的是这样的东西 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Xml; using System.Diagnostics; using System.IO;

因此,我一直在试图弄清楚,如何在程序所在的根文件夹之后打开一个文件夹。我要找的是这样的东西

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using System.Xml;
using System.Diagnostics;
using System.IO;

namespace Watcher
{

   static void Main(string[] args)
    {
      Process.Start("..\this.txt");
    }
 }

从我对其他语言的使用来看,..\意味着从根文件夹转发,但它似乎不起作用。有人知道如何让它起作用吗?

\t是tab。尝试使用“.\\this.txt”

你有错误吗?
this.txt
是否存在于预期位置?它能够作为一个过程开始吗?如果您使用该文件的绝对路径,是否有效?@David如果我使用的是我提供的“.\this.txt”,则系统错误无法找到指定的文件。但是我将this.txt与.exe放在同一个文件夹中,并使用Process.Start(“this.txt”)它将工作。。表示从当前文件夹向上一级,而不是从根文件夹向前。@user3448117:用正斜杠代替反斜杠怎么样?还可以尝试使用
Path.Combine()
或其他
Path
实用程序,以减少对平台的依赖性。也可以尝试
Process.Start(@.\this.txt”)