当前位置: 首页> 科技> 数码 > 企业网站有哪四种类型_邯郸百度爱采购_网络搭建是干什么的_千锋教育培训收费一览表

企业网站有哪四种类型_邯郸百度爱采购_网络搭建是干什么的_千锋教育培训收费一览表

时间:2025/7/9 17:05:10来源:https://blog.csdn.net/spencer_tseng/article/details/146985940 浏览次数:1次
企业网站有哪四种类型_邯郸百度爱采购_网络搭建是干什么的_千锋教育培训收费一览表

FileContextTool.java  文件内容修改,默认保存操作系统桌面

package zwf;import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;/*** 文件内容修改或者拼接测试* * @author ZengWenFeng* @date 2025.04.03* @email 117791303@qq.com* @mobile 13805029595*/
public class FileContextTool 
{public static void main(String[] args) {String os = System.getProperty("os.name").toLowerCase();String userHome = System.getProperty("user.home");String desktopPath;if (os.contains("win")) {desktopPath = userHome + "\\Desktop";}else if (os.contains("mac")) {desktopPath = userHome + "/Desktop";}else if (os.contains("nix") || os.contains("nux") || os.contains("aix")) {desktopPath = userHome + "/Desktop";}else{System.err.println("不支持的操作系统");return;}String inputFilePath = desktopPath + "/input.txt";String outputFilePath = desktopPath + "/output.txt";try (BufferedReader reader = new BufferedReader(new FileReader(inputFilePath));BufferedWriter writer = new BufferedWriter(new FileWriter(outputFilePath))) {String line;while ((line = reader.readLine()) != null){String modifiedLine = "\"   " + line + "   \",";writer.write(modifiedLine);writer.newLine();}System.out.println("文件处理完成,结果已保存到 " + outputFilePath);} catch (IOException e){System.err.println("处理文件时出现错误: " + e.getMessage());}}
}    

关键字:企业网站有哪四种类型_邯郸百度爱采购_网络搭建是干什么的_千锋教育培训收费一览表

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: