用ASP做一个记事本编缉器(附源码)

newDoc.asp
----------------------------------------------------------

1@ Language=VBScript 
1<script id="DebugDirectives" language="javascript" runat="server">   
2// Set these to true to enable debugging or tracing   
3@set @debug=false   
4@set @trace=false   
5</script>
 1<html>
 2<head>
 3<meta content="VBScript" name="VI60_defaultClientScript"/>
 4<meta content="Microsoft Visual Studio 6.0" name="GENERATOR"/>
 5<script id="clientEventHandlersVBS" language="vbscript">   
 6<!--   
 7  
 8Sub button2_onclick   
 9fo1.TEXTAREA1.style.fontFamily=select1.value   
10End Sub   
11  
12Sub button3_onclick   
13fo1.TEXTAREA1.style.fontSize=select2.value   
14End Sub   
15  
16Sub button4_onclick   
17if button4.value="Bold" then   
18button4.value="Un Bold"   
19fo1.TEXTAREA1.style.fontWeight="Bold"   
20else   
21button4.value="Bold"   
22fo1.TEXTAREA1.style.fontWeight="normal"   
23end if   
24End Sub   
25  
26Sub button5_onclick   
27if button5.value="Italics" then   
28button5.value="Un Italics"   
29fo1.TEXTAREA1.style.fontstyle="italic"   
30else   
31button5.value="Italics"   
32fo1.TEXTAREA1.style.fontstyle="normal"   
33end if   
34End Sub   
35Sub button6_onclick   
36window.close   
37End Sub   
38  
39\-->   
40</script>
41</head>
42<body>
43<font color="royalblue" face="arial" size="3"><b>ASP NOTEPAD</b></font>   

dim x
if Request("type")="save" then
x = 1
end if

1<object id="OBJECT1" progid="Scripting.FileSystemObject" runat="server"></object>
2<table bgcolor="blanchedalmond" border="0" cellpadding="1" cellspacing="1" width="100%">
3<tr>
4<td>   

if not len(request("doc"))=0 then

1<font face="arial" size="2">Document:<b> ```
2=Request.querystring("doc")
3```</b></font>   

else

1<font face="arial" size="2">Document:<b> Untitled</b></font>   

end if

 1</td>
 2</tr>
 3</table>
 4<p><select id="select1" name="select1" style="HEIGHT: 22px; WIDTH: 25%">
 5<option value="Times New Roman">Times New Roman</option>
 6<option value="System">System</option>
 7<option value="Arial">Arial</option>
 8<option value="Comic Sans MS">Comic Sans MS</option>
 9<option value="Courier">Courier</option>
10<option value="Courier New">Courier New</option>
11<option value="Verdana">Verdana</option>
12</select>
13<input id="button2" name="button2" type="button" value="Font"/>
14<select id="select2" name="select2" style="HEIGHT: 22px; WIDTH: 60px">
15<option value="8pt">8pt</option>
16<option value="9pt">9pt</option>
17<option selected="" value="10pt">10pt</option>   

for a=11 to 100

1<option value="```
2=a
3```pt">```
4=a
5```pt</option>   

next

 1</select>
 2<input id="button3" name="button3" type="button" value="Size"/>
 3<input id="button4" name="button4" type="button" value="Bold"/>
 4<input id="button5" name="button5" type="button" value="Italics"/>
 5<input id="button6" name="button6" type="button" value="Close Window"/><br/><br/>
 6<font face="arial" size="1">You will not be questioned on saving the changes</font></p>
 7<form =request.querystring("doc")="" ```="" action="newdoc.asp?type=save&amp;amp;ch=1&amp;amp;doc=```" id="fo1" method="post" name="fo1">
 8<input =request.querystring("doc")="" ```="" id="text1" name="text1" style="HEIGHT: 24px; WIDTH: 80%" value="```"/>
 9<input id="button1" name="button1" style="HEIGHT: 24px; WIDTH: 15%" type="submit" value="Save File"/>
10<hr width="100%"/>
11<br/>
12<textarea id="TEXTAREA1" name="TEXTAREA1" style="FONT-family: arial; FONT-SIZE: 10pt; HEIGHT: 50%; WIDTH:   
13100%">```
14if request("ch")=1 then   
15Response.Write request("textarea1")   
16end if   
17if len(request("text1"))&amp;gt;0 then   
18if OBJECT1.FileExists(Request("text")) then   
19OBJECT1.OpenTextFile(request("doc")).Write request("textarea1")   
20else   
21OBJECT1.CreateTextFile (request("text1"),true).Write Request("textarea1")   
22end if   
23end if   
24if not Request.QueryString("doc")="" and not Request("ch")=1 then   
25if OBJECT1.FileExists(Request.QueryString("doc")) then   
26Response.Write OBJECT1.OpenTextFile(Request.QueryString("doc")).ReadAll   
27else   
28Response.Write "&lt;????&gt; No document Exists &lt;????&gt;"   
29end if   
30end if   

``` aspnp.asp \---------------------------------------------------------------- ``` @ Language=VBScript ``` ```

ASP NOTEPAD




Author: Sharon Jayaraj
Platform: Win98
Application Used: Interdev(for easy Working) and PWS(for testing)

```
Published At
Categories with Web编程
Tagged with
comments powered by Disqus