我有以下的功能,相信能告诉我一个文件夹是否存在,但是当我把它,我得到这个错误 -错误传递“系统::字符串”的功能时
无法从 '系统字符串^ ::' 转换参数1 '的std :: string'
功能 -
#include <sys/stat.h>
#include <string>
bool directory_exists(std::string path){
struct stat fileinfo;
return !stat(path.c_str(), &fileinfo);
}
调用(从持有形式,其中form.h文件用户选择文件夹) -
private:
System::Void radioListFiles_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
if(directory_exists(txtActionFolder->Text)){
this->btnFinish->Enabled = true;
}
}
是否有人能告诉我如何filx这?谢谢。
我从来没有希望看到任何人在同一个调用中使用C++/CLI,STL *和* POSIX函数... – 2013-03-01 23:00:48
@Matteo:是的,这是相当可憎的... – ildjarn 2013-03-01 23:05:54
这几乎就像我不是很用C++过期,因此需要寻求帮助!我赞成你可能有一个笑,但有一些可惜我! – 2013-03-01 23:15:42