17.
uqish = gcnew IO::StreamReader(openFileDialog1->FileName,
18.
System::Text::Encoding::GetEncoding(1251));
19.
// bu yerda kril alifbosini oqish uchun Win1251 ni o'qish
20.
richTextBox1->Text = uqish->ReadToEnd();
21.
uqish->Close();
22.
chopQilishToolStripMenuItem->Visible = true; }
23.
catch(IO::FileNotFoundException^ Istisno){
24.
MessageBox::Show(Istisno->Message+ "\n Bunday fayl yo'q",
25.
"Xatolik", MessageBoxButtons::OK,
MessageBoxIcon::Exclamation);}
26.
catch(Exception^ Istisno){// Boshqa xatoliklar haqida xabar
27.
MessageBox::Show(Istisno->Message, "Xatolik",
28.
MessageBoxButtons::OK, MessageBoxIcon::Exclamation);} }
29.
private: System::Void chopQilishToolStripMenuItem_Click(
30.
System::Object^ sender, System::EventArgs^ e) {
31.
// Chop qilish menyu buyrug'i tanlanganda
32.
try{
33.
uqish = gcnew IO::StreamReader(openFileDialog1->FileName,
34.
System::Text::Encoding::GetEncoding(1251));
35.
try{
Do'stlaringiz bilan baham: |