当前位置:DOS资源站资料中心批处理教程 → BAT生成网页程序

BAT生成网页程序

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-4-19 20:43:35

代码很简单,容易懂,这里是把网页的HTML语言与批处理的结合,不会做网页的,也可以拿这个批处理给自己喜欢的人来个浪漫的表达方式!代码如下:
echo off&title DOS资源站 www.cmdos.net
title 魔法情书
cls
color fa
echo ^<html^>^ >index.htm
echo ^<head^>^ >>index.htm
set /p a=请输入网页标题:
echo ^<title^>^%a%^<^/title^>^ >>index.htm
echo ^</head^>^ >>index.htm
set /p f=你想要网页中的背景是(1图片、2颜色):
if /i "%f%"=="1" goto 1
if /i "%f%"=="2" goto 2
:1
set /p b=请编辑你想要的背景图片路径(例如:  c:\1.bmp、jpg、gif...如果在同一文件夹内,则可以直接输入文件名):
echo ^<body background=%b%^>^ >>index.htm
goto next
:2
set /p d=请编辑你想要的背景颜色(请直接输入6位颜色码):
echo ^<body bgcolor=%d%^>^ >>index.htm
goto next
:next
set /p c=请编辑你想要的背景音乐路径(例如: c:\1.mp3):
echo ^<embed src=%c% autostart="true" loop="true" hidden="true"^>^ >>index.htm
set /p e=请选择你想要的发光字体的颜色(1紫色、2黄色):
set /p g=请编辑文章标题:
set /p h=请设置标题大小(直接输入数字):
if /i "%e%"=="1" goto a
if /i "%e%"=="2" goto b
:a
echo ^<center^>^ >>index.htm
echo ^<font style="filter: glow(color=#FF9966,strength=3); height:10px; color:white; padding:1px" size=%h%^>^%g%^<^/font^>^ >>index.htm
echo ^</center^>^ >>index.htm
goto go
:b
echo ^<center^>^ >>index.htm
echo ^<font style="filter: glow(color=#9966FF,strength=3); height:10px; color:white; padding:1px" size=%h%^>^%g%^<^/font^>^ >>index.htm
echo ^</center^>^ >>index.htm
echo ^<br^>^ >>index.htm
echo ^<br^>^ >>index.htm
echo ^<br^>^ >>index.htm
echo ^<br^>^ >>index.htm
goto go
:go
set /p i=请输入你的甜言蜜语吧:
echo ^<center^>^ >>index.htm
echo ^<font style="filter: glow(color=#9966FF,strength=3); height:10px; color:white; padding:1px"^>^%i%^<^/font^>^ >>index.htm
echo ^</center^>^ >>index.htm
echo ^</body^>^ >>index.htm
echo ^</html^>^ >>index.htm
echo 恭喜你!完成拉!~发给你爱的人吧!祝福你们~
pause >nul