C++ Builder XE10 ChDir如何判断当前文件路径是否正确源码?

void __fastcall TForm1::Button1Click(TObject *Sender)
{

  Edit2->Text = GetCurrentDir();   //获取当前路径
  FileListBox1->Directory = GetCurrentDir();
  DirectoryListBox1->Directory = GetCurrentDir();
   try
  {
    System::ChDir(Edit2->Text);    //判断路径是否正确
  }
  catch (...)
  {
    MessageDlg("没有找到路径!", mtWarning, TMsgDlgButtons() << mbOK, 0);
  }
}

相关文章:

  • 2021-10-01
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-08-29
相关资源
相似解决方案