我在我的C#winform应用程序中使用下面的行,这很好用,但偶尔如果程序是从命令行运行的,我会收到一个config.xml无法找到文件的错误.这是因为'工作目录'是不同的(我认为),我需要说"从当前目录加载config.xml",我该怎么做?
docXML.Load("config.xml");
Run Code Online (Sandbox Code Playgroud)
谢谢乔纳森
我错过了什么或System.IO.FileStream不读取包含希伯来语的Unicode文本文件?
public TextReader CSVReader(Stream s, Encoding enc)
{
this.stream = s;
if (!s.CanRead)
{
throw new CSVReaderException("Could not read the given CSV stream!");
}
reader = (enc != null) ? new StreamReader(s, enc) : new StreamReader(s);
}
Run Code Online (Sandbox Code Playgroud)
谢谢乔纳森