0
我必須在文件夾中獲取文件。我的流程可以在批次中運行。如何在批處理過程中獲取文件夾中的文件?
我的代碼是這樣的:
Io file;
FileIoPermission perm;
int handle;
Filename fileName;
[handle, filename] = WINAPI::findFirstFile(myFilePatch + "\\*.txt");
fileOpen = strFmt (myFilePatch + "\\" + filename);
if (filename)
{
perm = new FileIoPermission(filename, 'r');
perm.assert();
file = new TextIo(filename, 'r', 65001);
}
//etc... other code
// I go on to find another file
filename = WinAPI::findNextFile(handle);
fileOpen = strFmt (myFilePatch + "\\" + filename);
if (filename)
{
// open file....
}
我的問題是WinAPI.findFirstFile
和WinAPI::findNextFile
我有一個錯誤。 如何在批處理文件夾中搜索文件?
Thansk全部,
享受!
你檢查[嘗試使用WINAPI ::上用FindFirstFile服務器上運行(http://stackoverflow.com/questions/8300111/try-to-use-winapifindfirstfile-running-on-Server)?這聽起來非常相似。請始終在您的問題中包含實際的錯誤信息。 –