麦丽 唱给爸爸的

You tuck me in, turn out the light 你给我把被子掖好,关上灯
Left me safe and sound at night 让我安心地躺着,聆听夜晚的声音
Little girls depend on things like that 小女孩们期待这个时刻

Brushed my teeth and combed my hair 刷牙,梳理头发
Had to drive me everywhere 开车带我去任何地方
You were always there when I looked back 当我回望时,你总在那儿

You had to do it all alone 你必须完成它
Make a living, make a home 经历一种生活,营造一个家
Must have been as hard as it could be 无论多艰苦

And when I couldn't sleep at night 当我夜里不能入睡时
Scared things wouldn't turn out right 害怕的东西袭来时
You would hold my hand and sing to me 你会握住我的手,轻声哼歌

Caterpillar in the tree 树里藏着的毛毛虫
How you wonder who you'll be 你疑惑你是谁
Can't go far but you can dream 无法走远,但还有梦想

Wish you may and wish you might 希望你可以
Don't you worry, hold on tight 别焦虑,坚持到底
I promise you there will come a day 我承诺你,美好的明天一定会到来
Butterfly fly away 蝴蝶可以远飞

Butterfly fly away (Butterfly fly away) 蝴蝶可以远飞(蝴蝶可以远飞)
Got your wings, now you can't stay 当你拥有翅膀,你就别停留原地
Take those dreams and make them all come true 带上梦想,让它们成为真实

Butterfly fly away (Butterfly fly away) 蝴蝶可以远飞(蝴蝶可以远飞)
You've been waiting for this day 你已经为这一天等了很久
All along and know just what to do 你知道要怎么做


吉他谱也拿来跟大家分享

Chords Used: Capo 4

Cadd9  - 032033
G6     - 020033
A7sus4 - 002033
Dsus4  - 000233
D      - 000232

Intro: Cadd9 - G6 - A7sus4 - G6- Cadd9 - G6 - A7sus4 - G6

    Cadd9
You tucked me in
       G6
Turned out the light
A7sus4           G6
Kept me safe and sound at night
Cadd9          G6                  A7sus4    G6
Little girls depend on things like that
Cadd9                G6
Brushed my teeth and combed my hair
A7sus4          G6
Had to drive me every where
Cadd9           G6                  A7sus4    G6
You were always there when I looked back

           Cadd9     G6
You had to do it all alone
       A7sus4         G6
Make a living, make a home
Cadd9            G6               A7sus4    G6
Must have bin as hard as it could be
           Cadd9             G6
And when I couldn't sleep at night
              A7sus4            G6
Scared things wouldn't turn out right
Cadd9             G6               Dsus4   D
You would hold my hand and sing to me


Cadd9              G6
Caterpillar in the tree
A7sus4         G6
How you wonder who you'll be
Cadd9            G6             A7sus4    G6
Can't go far but you can always dream
Cadd9            G6
Wish you may and wish you might
A7sus4           G6
Don't you worry, hold on tight
  Cadd9       G6                  Dsus4
I promise you there will come a day
D             Cadd9  G6  A7sus4  G6
Butterfly fly away

Cadd9          G6
Butterfly fly away(butterfly fly away)
A7sus4             G6
Got your wings now you can't stay
Cadd9                G6                  A7sus4    G6
Take those dreams and make them all come true
Cadd9          G6
Butterfly fly away(butterfly fly away)
A7sus4    G6
You've bin waiting for this day
Cadd9          G6                A7sus4    G6
All along and known just what to do

Cadd9      G6         A7sus4     G6             Cadd9
Butterfly, Butterfly, Butterfly, Butterfly fly away

End:
G6  A7sus4 G6
Cadd9  G6  A7sus4  G6
Cadd9  G6  A7sus4  G6  
Cadd9  G6  A7sus4  G6
Cadd9

-------------------------------------------------------------------------

Intro
e|---3--3--3--3---------|
B|---3--3--3--3---------|    
G|---0--0--0--0---------|x2
D|---2--0--2--0---------|
A|---3--2--0--2---------|
E|---0--0--0--0---------|

Verse 1 + 2
e|---3--3--3--3---------|
B|---3--3--3--3---------|    
G|---0--0--0--0---------|x4
D|---2--0--2--0---------|
A|---3--2--0--2---------|
E|---0--0--0--0---------|

Verse 1:
You tucked me in, turned out the light
kept me safe and sound at night
Little girls depend on things like that

Verse 2:
Brushed my teeth and combed my hair
Had to drive me everywhere
You were always there when I looked back

Bridge
e|---3--3--3--3---------|
B|---3--3--3--3---------|    
G|---0--0--0--0---------|x4
D|---2--0--2--0---------|
A|---3--2--0--2---------|
E|---0--0--0--0---------|

Bridge:
You had to do it all alone
Make a living, make a home
Must've been as hard as it could be

And when I couldn't sleep at night
Scared things wouldn't turn out right
You would hold my hand and sing to me

Chorus
e|---3--3--3--3--3--3--3--3----|
B|---3--3--3--3--3--3--3--3----|
G|---0--0--0--0--0--0--0--1----|x2
D|---0--2--0--0--0--0--2--0----|
A|---2--3--2--0--2--2--0--0----|
E|---3--0--3--2--0--0--0--0----|

Chorus:
Caterpillar in the tree
How you wonder who you'll be
Can't go far but you can always dream

Wish you may and wish you might
Don't you worry, hold on tight
I promise you there will come a day
Butterfly fly away

Verse 3 + 4
e|---3--3--3--3---------|
B|---3--3--3--3---------|    
G|---0--0--0--0---------|x5
D|---2--0--2--0---------|
A|---3--2--0--2---------|
E|---0--0--0--0---------|

Verse 3:
Butterfly fly away (Butterfly fly away)
Got your wings, now you can't stay
Take those dreams and make them all come true

Verse 4:
Butterfly fly away(Butterfly fly away)
You've been waiting for this day
All along and know just what to do

Outro
e|---3--3--3--3---------|
B|---3--3--3--3---------|    
G|---0--0--0--0---------| Play till the end. End on ---3---
D|---2--0--2--0---------|                           ---3---  
A|---3--2--0--2---------|                           ---0---
E|---0--0--0--0---------|                           ---2---
                                                    ---3---
Outro:                                              ---0---
Butterfly, Butterfly, Butterfly
Butterfly fly away

Butterfly fly away

Butterfly fly away
无组件上传类 要将保存文件的名称不改变,可以如下
sub upload_0()    '使用化境无组件上传类
  set upload=new upload_file    '建立上传对象
  for each formName in upload.file '列出所有上传了的文件
    set file=upload.file(formName)  '生成一个文件对象
    if file.filesize<100 then
      msg="请先选择你要上传的文件!"
      founderr=true
    end if
    if file.filesize>(MaxFileSize*1024) then
      msg="文件大小超过了限制,最大只能上传" & CStr(MaxFileSize) & "K的文件!"
      founderr=true
    end if

    fileExt=lcase(file.FileExt)
    Forumupload=split(UpFileType,"|")
    for i=0 to ubound(Forumupload)
      if fileEXT=trim(Forumupload(i)) then
        EnableUpload=true
        exit for
      end if
    next
    if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
      EnableUpload=false
    end if
    if EnableUpload=false then
      'msg="这种文件类型不允许上传!\n\n只允许上传这几种文件类型:" & UpFileType
                        response.write"<SCRIPT language=JavaScript>alert('这种文件类型不允许上传!\n\n只允许上传这几种文件类型:" & UpFileType & "');"
                        response.write"javascript:history.go(-1)</SCRIPT>"
         founderr=true
    end if
    
    strJS="<SCRIPT language=javascript>" & vbcrlf
    if founderr<>true then
      randomize
      ranNum=int(900*rnd)+100
filename=SavePath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt

......

可以改为:
filename=SavePath&file.filename
采用WEB技术实现B/S(浏览器/服务器)结构的管理系统是办公自动化的发展趋势。基于WEB技术的管理系统,由于开发周期短;与用户平台无关;易于实现交互式应用;能对信息进行快速、高效的收集、处理和发布,近几年来得到了迅速发展。而ASP技术由于其开发效率高、交互性好,安全性强等特点,逐渐成为开发管理系统的首选工具。

  许多基于WEB的应用都涉及文件上传操作。常见的文件上传技术有:基于HTTP协议的;基于VB(或DELPHI等编程语言)开发的文件上传组件的;基于数据库技术的等等。这些方法一般都需要编程者能同时掌握WEB技术、数据库技术或CGI技术或组件技术,对编程者的要求较高。而本文将介绍的利用ASP技术直接实现文件上传功能则只需编程者掌握单一的ASP技术即可,大大降低了编程难度。

  几种文件上传技术的比较

  1、基于HTTP协议

  该方法需要编程者利用第三方软件,如DELPHI、VB等,在应用程序中先进行HTTP协议编程,然后将待上传文件内容按HTTP协议的格式打包,最后向WEB服务器发送上传的请求报文,从而实现文件的上传。因为DELPHI和VB不能编写完整的WEB网络程序,只能编写WEB小应用程序,因此,该方法只用于功能受限的网络应用。

  2、基于VB(或DELPHI等)开发的文件上传组件

  该方法利用VB(或DELPHI等编程语言)开发ASP服务器组件,实现特定的文件上传服务。它首先利用ASP表单功能将文件(二进制格式)从用户端上传到服务器端,然后使用VB开发的组件,对二进制文件进行处理,成为可以正常读写的文件。该方法要求编程者不仅掌握ASP语言,而且还能利用VB等第三方语言进行组件编程,增加了开发的难度。

  3、基于数据库技术

  该方法和上个方法有类似之处。不同的地方在于对上传的二进制文件的处理上。它使用数据库来保存二进制文件。无论是小型数据库还是大型数据库都提供了存储二进制数据的数据类型,只要以Append Chunk方式将数据存入相应的字段就可以了。该方法虽然简单可行,但是因为每次上传的文件大小都是不一样的,因此,会对数据库的空间造成很大的浪费,降低了数据的访问速度;并且使得文件只能在数据库环境下进行访问,造成了很大的不便。

  实例分析

  但是,利用ASP技术直接实现文件上传功能则只需编程者掌握单一的ASP技术即可,

  大大降低了编程难度。下面我们将通过一个实例来介绍如何使用该方法。

  1、文件上传表单

  首先需要编写一个能提供文件上传功能的表单,程序如下所示:

<Form action="upload.asp" method=post enctype="multipart/form-data">
上传文件:<Input type=file name=file1><br>
<input type=submit name=upload value="上传">
</form>

  其中,enctype参数用来设置表单的MIME编码方式,在进行文件(或同时包含文本框)上传时,必须将其属性设置为"multipart/form-data";upload.asp是服务器端对接收到的二进制文件流进行处理的ASP程序,在本文的后面将陆续介绍其内容。

  2、上传文件格式分析

  在处理文件之前,我们要先了解上传的文件的具体格式,通过编写下面一段简单的ASP程序就可以查看其二进制代码:

<%
filesize=Request.TotalBytes '获得上传文件的大小
filedata=Request.BinaryRead(filesize) '获得上传文件的二进制数据
Response.BinaryWrite filedata '在浏览器上显示二进制数据
%>

  分析浏览器上显示的上传文件的二进制代码,发现代码包括四个部分(若同时上传多个文件或文本框,则代码按上传的先后次序排列,格式相同),每一部分的内容是用回车换行符号来进行分隔的:

  1)第一部分(起始标志)
  -----------------------------7d329631b04d4
  2)第二部分(文件说明)

Content-Disposition: form-data; name="file1"; filename="C:\Documents and Settings\Administrator\My Documents\Invitation.doc" Content-Type: application/msWord

  在此,我们可以获得上传文件的文件名称及绝对路径,也可以获得文件类型。这些信息是正确保存文件所不可缺少的。
  
  3)第三部分(文件内容)

  即文件的二进制内容,略。

  4)第四部分(结束标志)

-----------------------------7d329631b04d4

  结合第一部分和第四部分的内容来看,"-----------------------------7d329631b04d4"(每次上传,数值都不一样)起到了分割符的作用,它标志着一段数据(当有多个上传内容时)的开始和结束。从保存文件所需要的信息来讲,我们首先需要从第二部分数据的"filename"中获得文件名称,然后需要正确定位文件的起始位置,最后利用ASP技术将二进制文件用本来的文件名保存即可。若同时上传多个内容(如多个文本框和文件),也是按同样的方法处理,每部分的内容都包含在分割符之中,只是文本框和文件的表现形式稍有不同,这可以通过具体分析其二进制代码来了解。

  3、利用ASP技术实现文件存储

  上传文件代码的处理

  1) 获得分割符代码

  从上面的分析我们已经知道,分割符起到了分割多个数据段(包括文本框和各种类型的文件)的重要作用。前面已经分析过,分割符出现在第一个回车换行符号前。因此,通过下面这段程序就可获得分割符代码:

<%
newline=chrB(13) & chrB(10) 'newline表示二进制的回车符
filesize=Request.TotalBytes 'filesize是上传文件的大小
filedata=Request.BinaryRead(filesize) 'filedata是上传文件的二进制数据
divider=leftB(filedata,clng(instrb(filedata,newline))-1) 'divider是分割符
%>

  注:因为这里处理的都是二进制字节码,因此,所有的函数都是使用它的二进制版本,加了"b "。

  2) 获得文件(或文本框)内容

  (1) 预备函数(将二进制串转化成字符串)

  上传文件的内容不需要经过二进制向字符串的转换过程,直接保存就可。但是,若需提取文本框内容或文件的名称,就必须进行转换。因此,需要编写一个通用的,并且适用于汉字的转换函数。以下是该函数代码:

Function BtoS (bstr)
If not Is Null (bstr) Then
for i = 0 to lenb(bstr) - 1
bchr = midb(bstr,i+1,1)
If ascb(bchr)>127 Then '汉字是双字节,得两个字符一起处理
temp = temp&chr(ascw(midb(bstr, i+2, 1)&bchr))
i = i+1
Else
temp = temp&chr(ascb(bchr))
End If
next
End If
BtoS = temp
End Function  

  (2) 获得文件(或文本框)内容

  在实际的WEB应用中,上传操作可能涉及多项内容,如多个文本框、多个文件等等。文件和文本框很好区分,文件的数据中包含了"filename="字串。因此,我们写了如下的通用函数,既可用于提取文件内容,又可提取文本框内容(需进行二进制转换):

Function getdata(byval data, byval divider, final) 'data表示二进制串;divider表示分割符;final表示数据的结束位置
filename=chrb(102)&chrb(105)&chrb(108)&chrb(101)&chrb(110)&chrb(97)&chrb(109)&chrb(101)&chrb(61)&chrb(34) '字符串"filename"的二进制表示
bncrlf=chrb(13)&chrb(10) '二进制的回车符
startpos = instrb(data,divider)+lenb(divider)+lenb(bncrlf) ' 开始位置
endpos = instrb(startpos,data, divider)-lenb(bncrlf) '结束位置
part1 = midb(data, startpos, endpos-startpos) '两个分割符之间的内容
firstline = midb(part1, 1, instrb(part1, bncrlf)-1) ' 内容之前的说明段
If (instrb(firstline,filename)=0) Then '若为文本框,获得文本框字符串内容
stemp=midb(part1,instrb(part1,bncrlf&bncrlf)+lenb(bncrlf&bncrlf),lenb(part1)-instrb(part1,bncrlf&bncrlf)+lenb(bncrlf&bncrlf))
getdata=BtoS(stemp)
Else '若为文件,获得文件二进制内容
Getdata=midb (part1, instrb (part1, bncrlf&bncrlf)+lenb (bncrlf&bncrlf), lenb (part1)
-instrb(part1,bncrlf&bncrlf)+lenb(bncrlf&bncrlf))
End If
Final=endpos
End function

  在程序中直接调用该函数就可获得所需文件(或文本框)内容,如下所示:

<%
Content=getdata (data, divider, position)
%>

  3) 获得文件名称
  前面已经分析过了,上传文件数据流的"filename="字段里包含了文件的名称和绝对路 径。一般来说,我们只需提取出路径中的文件名即可,以下是程序代码:

<%
namepos=instrrev(B2S(firstline),chr(92)) 'firstline即上面获得的说明部分数据,chr(92)
表示"/"
filename=midb(firstline,namepos+1,lenb(firstline)-namepos-1) '获得文件名称
%>

  利用ASP直接实现文件上传功能

  传统的ASP程序员只能利用FILESYSTEMOBJECT对象对文本文件(.txt)进行移动、复制、删除等操作,若需处理二进制对象,则不得不采用本文前面介绍的那些方法来实现。但是,现在ASP中的ADO.STREAM对象可以同时操作文本对象和二进制对象(可以在http://www.microsoft.com/data下载),利用它就可以在ASP中直接实现文件上传功能。下面,我们就介绍其实现过程。

  1)打开STREAM对象

  对于SREAM对象而言,若要进行文件的保存,则必须是将该对象的全部内容进行保存。因此,我们必须要创建两个(或多个)STREAM对象,其中一个为源数据流,即接收初始的二进制数据;另一个为目的数据流,即接收来自经源数据流处理后的数据,并最终保存为所需的文件。

<%
set str=Server.CreateObject("ADODB.Stream") 'str为源数据流
str.Mode=3 '设置打开模式,3为可读可写
str.Type=1 '设置数据类型,1为二进制数据
str.Open
set desc=server.CreateObject("ADODB.Stream") 'desc为目标数据流
desc.Mode=3
Desc.Type=1
desc.Open
%>

  2)STEAM对象间内容的复制

  在该部分,必须在源数据流中定位文件开始的位置,并且求出文件内容的长度,才能将文件正确的复制到目的数据流中,并且保存文件,程序代码如下:

<%
formdata=Request.BinaryRead(Request.TotalBytes) 'formdata为上传的所有内容
str.Write formdata ' 赋值源数据流
str.position=count-lenb(result)-2 'position指出文件的开始位置
str.copyto desc, lenb(filecotent) 'lenb(filecontent)表示文件的长度
desc.SaveToFile fullpath,2 '以fullpath指定的路径及名称保存文件
%>

  3)关闭STEAM对象

  编程完成后,应关闭并释放STEAM对象,如下所示:

<%
Desc. Close
Set desc=nothing
Str. Close
Set STR=nothing
%>

  总结

  本文给出了利用ASP直接实现文件上传的方法,在本单位自行开发的信息管理系统中得到了很好的应用。实践证明:与传统的几种文件上传方法相比,该方法更简便、更高效。
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]