简单Web服务器设计与实现课程设计(17)

2021-01-20 18:12

计算机网络课设报告,java平台实现,Java;HTTP;Web服务器

}

catch(Exception ex)

{

ex.printStackTrace();

System.out.println("3");

//continue;

}

}

private void reBuildConfig(File file)

{

try

{

file.createNewFile();

FileOutputStream fos=new FileOutputStream(file);

PrintStream sp=new PrintStream(fos);

sp.println("WEB_ROOT=");

sp.println("PORT=");

sp.close();

System.out.println("配置文件Config.ini创建成功,您可以修改WEB_ROOT的值改变网页文件的存放路径,修改PORT的值改变访问端口!");

}

catch (IOException ex)

{

ex.printStackTrace();

System.out.println("重建配置文件Config.ini失败");

System.out.println("服务器将使用默认配置...");

}

}

private void reBuildWeb(File file)

{

try

{

file.createNewFile();

FileOutputStream fos=new FileOutputStream(file);

PrintStream sp=new PrintStream(fos);

sp.println("<html>");

sp.println("<head>");

sp.println("<title>简单Web服务器</title>");

sp.println("</head>");

sp.println("<body>");

sp.println("<div align="+"center"+">服务器已经成功运行 </div>");

sp.println("</body>");

sp.println("</html>");

sp.close();


简单Web服务器设计与实现课程设计(17).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2013年中国十大证券公司排行榜

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: