代码
function readFile( szPath )
local hFile,nErr = assert(io.open(szPath,"r"))
if (nErr ~= nil) then return nErr end;
local szText = hFile:read("*all");
hFile:close();
return szText
end
print (readFile("test.txt"))
function readFile( szPath )
local hFile,nErr = assert(io.open(szPath,"r"))
if (nErr ~= nil) then return nErr end;
local szText = hFile:read("*all");
hFile:close();
return szText
end
print (readFile("test.txt"))
sollyu
这个人很懒,什么都没留下