局域网内读取文件
static void Main(string[] args) { FileStream fs = new FileStream(@"\\1.2.3.4\XXX\Debug\log\log.txt", FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(fs, Encoding.GetEncoding("GBK")); String log=reader.ReadToEnd(); reader.Close(); reader.Dispose(); Console.ReadLine(); }
注解:该文件需是共享的