-1

私のフォーム 1 がフォーム 2 を開こうとするたびに、このエラーが発生します...

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

Additional information: Input string was not in a correct format.

これは何を意味するのでしょうか?Form2を開くために使用するコードは次のとおりです...

if (TimerValue == 5000)
         {
             this -> timer1 -> Stop();
             TimerValue = 0;
             Form2 ^ f2 = gcnew Form2;
             f2->Show();
             MoviePlay = 1;
             StreamWriter^ outFile = gcnew StreamWriter("Movie.txt");
             String^ Movie = MoviePlay.ToString();
             outFile->Write(Movie);
             outFile->Close();
             this -> button4 ->Visible = false;
             this -> button5 ->Visible = false;
             this -> label2 ->Visible = false;
             this -> button2 ->Visible = false;
             this -> button3 ->Visible = false;
             FriendString = File::ReadAllText(".\\Rca13\\Friend.txt");
             Friend = System::Convert::ToInt32(FriendString);
             if (Friend == 1)
             {
             this -> pictureBox1 -> Load("RetaliationBackground1_Pony1");
             }
             if (Friend == 2)
             {
             this -> pictureBox1 -> Load("RetaliationBackground1_Pony2");
             }
             if (Friend == 3)
             {
             this -> pictureBox1 -> Load("RetaliationBackground1_Pony3");
             }
             if (Friend == 4)
             {
             this -> pictureBox1 -> Load("RetaliationBackground1_SwagMasta");
             }

         }

このコードにエラーの原因となっているものはありますか?

4

1 に答える 1