你能告诉我为什么这段代码会出错吗?
我不明白这一行:File.new("#{line}", "w")
system "ipconfig /all > info.txt"
info_text = File.open("info.txt")
info_text.each { |line|
if line =~ /Physical Address/
line.slice! " Physical Address. . . . . . . . . : "
File.new("#{line}", "w")
end
}
谢谢-迈克·W