解决方案 »

  1.   

    参考:string tempStr=null; StreamReader sr = new StreamReader(FileName,System.Text.Encoding.Default);while(tempStr!=battle&&(tempStr=sr.ReadLine())!="[结束]"); if(tempStr.Equals("[结束]")) return;   //找不到旗局名称,则退出
    tempStr=sr.ReadLine();    //略过战役名称
    tempStr=tempStr.Trim();
    int index=0;
    while(!tempStr.Equals("[END]"))
    {
    string[] str=new string[9];
    str=tempStr.Split(' ');
    foreach(string str1 in str)
    {
    string str2;
    str2=str1.Trim();
    if(str1.CompareTo("                                                           ")>0)
    soldiers[index++]=str2;
    }
    tempStr=sr.ReadLine();

    for(int i=0;i<32;i++)
    {
    if(soldiers[i]!="NULL")
    {
    this.pictureBoxs[i].Image=(Image)myHT[soldiers[i]];
    continue;
    }
    this.pictureBoxs[i].Visible=false;
    }
    sr.Close();