Cześć :)
Piszę program który ma pobierać dane z pliku tekstowego.
Ładuję ten tekst do RichTextBox'a a poniższy kod z tego co mi się wydaje powinien utworzyć tablicę o długości = liczbie linii jakie sa zapisane w textbox'ie.
do tej tablicy powinien zaladowac ciagi znakow, program sie kompiluje ale kiedy przyciskam button to program sie zawiesza na tym zadaniu.
private: System::Void but_Click(System::Object^ sender, System::EventArgs^ e)
{
// Create a string array and store the contents of the Lines property.
array<String^>^ tempArray = gcnew array<String^>( txt->Lines->Length );
tempArray = txt->Lines;
// Loop through the array and send the contents of the array to debug window.
for ( int counter = 0; counter < tempArray->Length; counter++ )
{
System::Diagnostics::Debug::WriteLine( tempArray[ counter ] );
}
lbl -> Text= System::Convert::ToString(tempArray[1]);