HANDLE hFind = FindFirstFile("C:\semester2", &data); // DIRECTORY
You got the directory because that's what you asked for. If you want the files, ask for them:
HANDLE hFind = FindFirstFile("C:\semester2\*", &data); // FILES
(You can instead use *.*
if you prefer, but apparently this only works because of a backwards compatibility hack so should probably be avoided. See comments and RbMm's answer.)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…