Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在事件处理程序中读取 txt 文件
private void abc (object sender, routedEventArgs e) { string [] x= File.ReadAllLinwes(path); }
我收到错误:当前内容中不存在名称 FILE
那么,如何从 xaml.cs 文件中的文本文件中读取?应该进口什么?
该类File位于命名空间中System.IO。因此,添加using System.IO;到 C# 文件的顶部很可能会解决问题。
File
System.IO
using System.IO;