将文本读入一行后存入一字符串str中,假设三个数以逗号分隔,
string [] pp = new string[3]
pp = str.Split(',');

解决方案 »

  1.   

    本示例使用 StreamReader 类的 ReadToEnd 方法将文本文件的内容读入到字符串中。
    示例
    // Read the file as one string.
    System.IO.StreamReader myFile =
       new System.IO.StreamReader("c:\\test.txt");
    string myString = myFile.ReadToEnd();myFile.Close();// Display the file contents.
    Console.WriteLine(myString);
    // Suspend the screen.
    Console.ReadLine();
      

  2.   

    http://expert.csdn.net/Expert/topic/2539/2539409.xml?temp=.2426569
    一定能帮助你的,自己看把!