語法:fs.readFile(path[, options], callback)方式一:不傳編碼參數(shù)1 2 3 4 5 6 7 8 //參數(shù)1: 文件的名字 //參數(shù)2: 讀取文件的回調函數(shù) //參數(shù)1:錯誤對象,如果讀取失敗,err會包含錯誤信息,如果讀取成功,err是null //參數(shù)2:讀取成功后的數(shù)據(jù)(是一個Buffer對象) fs.readFile("data.txt", function(...
www.dbjr.com.cn/article/2580...htm 2025-6-7