html做的记事本(转至http://blog.donews.com/tabris17/archive/2004/06/01/24230.aspx)
2008-09-10 15:29
471 查看
html都能做记事本,只能佩服了,直接贴代码
<HTML>
<HEAD>
<TITLE>记事本</TITLE>
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" BORDER="thick" BORDERSTYLE="normal" CAPTION="yes"
ICON="notepad.exe" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="no"
SYSMENU="yes" VERSION="1.0" WINDOWSTATE="normal" N***IGABLE="yes" SCROLL="no" INNERBORDER="no">
<style>
.menu{font-size:9pt;padding-top:4px;padding-right:4px;padding-bottom:2px;padding-left:4px;}
textarea{height:expression(document.body.clientHeight-menu.clientHeight-1);width:100%;}
.menuhelp{position:absolute;top:21px;border-width:1;border-style:solid;visibility:hidden;
border-top-color:Menu;border-left-color:Menu;border-bottom-color:black;border-right-color:black}
.popmenu{padding-top:4px;padding-right:20px;padding-bottom:4px;padding-left:20px;
border-width:1;border-style:solid;border-bottom-color:gray;border-right-color:gray}
</style>
<script>
function nosel()
{
window.event.returnValue=false;
}
function showmenu(menuid)
{
switch(menuid)
{
case 1:popopen.style.visibility="visible";break;
case 2:popedit.style.visibility="visible";break;
case 3:break;
case 4:pophelp.style.visibility="visible";break;
}
}
function hidemenu()
{
pophelp.style.visibility="hidden";
popopen.style.visibility="hidden";
popedit.style.visibility="hidden";
}
function selall()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.collapse(false);scrollTo(0,0);
}
function copytext()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
scrollTo(0,0);
}
fso = new ActiveXObject("Scripting.FileSystemObject");
fn=null;
function opendialog()
{
fn=prompt("输入你要打开的文件路径:","notepad.hta");
if(fn!=null)
{
var file = fso.OpenTextFile(fn);
var filetext = file.ReadAll();
workshop.value=filetext;
}
}
function savefile()
{
if(fn!=null)
{
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
function saveas()
{
var fntmp=prompt("输入你要保存的文件路径:",fn);
if(fntmp!=null)
{
fn=fntmp;
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
</script>
</HEAD>
<BODY leftmargin=0 rightmargin=0 topmargin=0 id=form bgcolor="Menu">
<table oncontextmenu="nosel()" onselectstart="nosel()" id=menu align=center bgcolor=Menu border=0 width=100% cellpadding=0 cellspacing=0 style="border-collapse: collapse">
<tr>
<td width=220>
<table class=menu width=220 border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" onmouseover="this.style.cursor='default'">
<tr>
<td align=center id=file width=55 onclick="hidemenu();showmenu(1)">文件<font face="MS Gothic">(F)</font></td>
<td align=center id=edit width=55 onclick="hidemenu();showmenu(2)">编辑<font face="MS Gothic">(E)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(3)">格式<font face="MS Gothic">(O)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(4)">帮助<font face="MS Gothic">(H)</font></td>
</tr>
</table>
</td>
<td align=left onclick=hidemenu() style=color:Menu onmouseover=this.style.cursor='default'>Create by:tabris17</td>
</tr>
</table>
<div class=menuhelp id=pophelp style="left:165px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();window.open('http://www.20cn.net/~tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">帮助主题<font face="MS Gothic">(H)</font></td></tr>
<tr><td style="line-height:0;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=116></td></tr>
<tr><td onclick="hidemenu();alert('Copyleft:tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关于记事本<font face="MS Gothic">(A)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popopen style="left:0px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();opendialog();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">打开<font face="MS Gothic">(O)</font></td></tr>
<tr><td onclick="hidemenu();savefile();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">保存<font face="MS Gothic">(S)</font></td></tr>
<tr><td onclick="hidemenu();saveas();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">另保为<font face="MS Gothic">(A)</font>...</td></tr>
<tr><td onclick="hidemenu();workshop.value='';fn=null;" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关闭<font face="MS Gothic">(C)</font></td></tr>
<tr><td style="height:1px;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=100></td></tr>
<tr><td onclick="hidemenu();window.close();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">退出<font face="MS Gothic">(X)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popedit style="left:55px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();selall()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">全选<font face="MS Gothic">(A)</font></td></tr>
<tr><td onclick="hidemenu();copytext()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">复制全部<font face="MS Gothic">(C)</font></td></tr>
</table>
</div>
<textarea style="font-family:Fixedsys;" id=workshop application=yes scrolling=yes width=100% onclick="hidemenu()"></textarea>
</BODY>
</HTML>
将文件保存为 notepad.hta
<HTML>
<HEAD>
<TITLE>记事本</TITLE>
<HTA:APPLICATION ID="oHTA" APPLICATIONNAME="myApp" BORDER="thick" BORDERSTYLE="normal" CAPTION="yes"
ICON="notepad.exe" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="no"
SYSMENU="yes" VERSION="1.0" WINDOWSTATE="normal" N***IGABLE="yes" SCROLL="no" INNERBORDER="no">
<style>
.menu{font-size:9pt;padding-top:4px;padding-right:4px;padding-bottom:2px;padding-left:4px;}
textarea{height:expression(document.body.clientHeight-menu.clientHeight-1);width:100%;}
.menuhelp{position:absolute;top:21px;border-width:1;border-style:solid;visibility:hidden;
border-top-color:Menu;border-left-color:Menu;border-bottom-color:black;border-right-color:black}
.popmenu{padding-top:4px;padding-right:20px;padding-bottom:4px;padding-left:20px;
border-width:1;border-style:solid;border-bottom-color:gray;border-right-color:gray}
</style>
<script>
function nosel()
{
window.event.returnValue=false;
}
function showmenu(menuid)
{
switch(menuid)
{
case 1:popopen.style.visibility="visible";break;
case 2:popedit.style.visibility="visible";break;
case 3:break;
case 4:pophelp.style.visibility="visible";break;
}
}
function hidemenu()
{
pophelp.style.visibility="hidden";
popopen.style.visibility="hidden";
popedit.style.visibility="hidden";
}
function selall()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.collapse(false);scrollTo(0,0);
}
function copytext()
{
var rng = workshop.createTextRange();
rng.moveToElementText(workshop);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
scrollTo(0,0);
}
fso = new ActiveXObject("Scripting.FileSystemObject");
fn=null;
function opendialog()
{
fn=prompt("输入你要打开的文件路径:","notepad.hta");
if(fn!=null)
{
var file = fso.OpenTextFile(fn);
var filetext = file.ReadAll();
workshop.value=filetext;
}
}
function savefile()
{
if(fn!=null)
{
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
function saveas()
{
var fntmp=prompt("输入你要保存的文件路径:",fn);
if(fntmp!=null)
{
fn=fntmp;
var file = fso.CreateTextFile(fn,true);
file.Write(workshop.value);
file.close();
}
}
</script>
</HEAD>
<BODY leftmargin=0 rightmargin=0 topmargin=0 id=form bgcolor="Menu">
<table oncontextmenu="nosel()" onselectstart="nosel()" id=menu align=center bgcolor=Menu border=0 width=100% cellpadding=0 cellspacing=0 style="border-collapse: collapse">
<tr>
<td width=220>
<table class=menu width=220 border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" onmouseover="this.style.cursor='default'">
<tr>
<td align=center id=file width=55 onclick="hidemenu();showmenu(1)">文件<font face="MS Gothic">(F)</font></td>
<td align=center id=edit width=55 onclick="hidemenu();showmenu(2)">编辑<font face="MS Gothic">(E)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(3)">格式<font face="MS Gothic">(O)</font></td>
<td align=center id=option width=55 onclick="hidemenu();showmenu(4)">帮助<font face="MS Gothic">(H)</font></td>
</tr>
</table>
</td>
<td align=left onclick=hidemenu() style=color:Menu onmouseover=this.style.cursor='default'>Create by:tabris17</td>
</tr>
</table>
<div class=menuhelp id=pophelp style="left:165px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();window.open('http://www.20cn.net/~tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">帮助主题<font face="MS Gothic">(H)</font></td></tr>
<tr><td style="line-height:0;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=116></td></tr>
<tr><td onclick="hidemenu();alert('Copyleft:tabris17');" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关于记事本<font face="MS Gothic">(A)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popopen style="left:0px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();opendialog();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">打开<font face="MS Gothic">(O)</font></td></tr>
<tr><td onclick="hidemenu();savefile();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">保存<font face="MS Gothic">(S)</font></td></tr>
<tr><td onclick="hidemenu();saveas();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">另保为<font face="MS Gothic">(A)</font>...</td></tr>
<tr><td onclick="hidemenu();workshop.value='';fn=null;" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">关闭<font face="MS Gothic">(C)</font></td></tr>
<tr><td style="height:1px;padding-left:1;padding-right:1;padding-bottom:0;padding-top:0;"><hr width=100></td></tr>
<tr><td onclick="hidemenu();window.close();" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">退出<font face="MS Gothic">(X)</font></td></tr>
</table>
</div>
<div class=menuhelp id=popedit style="left:55px;">
<table onselectstart="nosel()" onmouseover="this.style.cursor='default'" class=popmenu border=0 bgcolor=Menu cellpadding=0 cellspacing=1 style=border-collapse: collapse style="font-size:9pt">
<tr><td onclick="hidemenu();selall()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">全选<font face="MS Gothic">(A)</font></td></tr>
<tr><td onclick="hidemenu();copytext()" onmouseover="this.style.background='#0a246a';this.style.color='white'" onmouseout="this.style.background='Menu';this.style.color='black'">复制全部<font face="MS Gothic">(C)</font></td></tr>
</table>
</div>
<textarea style="font-family:Fixedsys;" id=workshop application=yes scrolling=yes width=100% onclick="hidemenu()"></textarea>
</BODY>
</HTML>
将文件保存为 notepad.hta
相关文章推荐
- 一种盗链的简单方法(转载至http://blog.donews.com/tabris17/archive/2004/08/14/68448.aspx)
- 最强最全的Tree命令详解 http://www.blogjava.net/coderdream/archive/2008/01/18/176352.html
- Struts2架构流程-转自http://www.blogjava.net/huamengxing/archive/2009/10/21/299153.html
- http://www.blogjava.net/xylz/archive/2013/08/05/402405.html
- http://www.blogjava.net/zyl/archive/2006/12/29/90802.html maven 配置篇 之 settings.xml
- MVC演化 (转至http://www.cnblogs.com/wubaiqing/archive/2011/10/26/2225438.html)
- linux下使用tar命令 (转至http://www.cnblogs.com/li-hao/archive/2011/10/03/2198480.html)
- http://www.blogjava.net/xylz/archive/2010/07/08/325587.html
- 启动其他APK的Activity方法 (转至http://www.cnblogs.com/lijunamneg/archive/2013/02/26/2934060.html)
- svm入门 转自 http://www.blogjava.net/zhenandaci/archive/2009/02/13/254519.html
- windows核心编程--内存结构 http://www.cppblog.com/mzty/archive/2006/09/20/12764.html
- windows phone 7 中文天气预报应用--来源http://www.cnblogs.com/liulunet/archive/2011/08/17/2141696.html
- HttpURLConnection学习 http://www.blogjava.net/jjshcc/archive/2010/07/21/326762.html
- 收藏的JAVA面试题大全(http://www.blogjava.net/bibi/archive/2006/07/18/58701.html)
- http://www.cnitblog.com/seeyeah/archive/2009/03/15/55440.html
- 动态库与静态库的使用,摘自http://www.blogjava.net/davidgw/archive/2009/01/21/252230.html
- http://www.blogjava.net/woxingwosu/archive/2007/11/28/163308.html
- 简化Spring(4)--View层http://www.blogjava.net/calvin/archive/2005/08/24/10914.html
- java反射详解 (转至 http://www.cnblogs.com/rollenholt/archive/2011/09/02/2163758.html)
- 提高asp.net应用程序性能的一些技巧(转自http://blog.aspcool.com/chyich/archive/2005/07/05/2584.html)