这个不起作用:
string fileContent = Resource.text;
StreamReader read = File.OpenText(fileContent);
string line;
char[] splitChar = "|".ToCharArray();
while ((line = read.ReadLine()) != null)
{
string[] split = line.Split(splitChar);
string name = split[0];
string lastname = split[1];
}
read.Dispose();
如何打开资源文件以获取其内容?
StreamReader
读取它可能无法提供您想要的信息。请参阅 @Arnaud F. 提供的答案以从流中读取文本资源。 - Jim Mischel