% Content=Content&"
" & vbNewLine from=Request("from") oto=Request("to") num=Request("num") url="http://download.finance.yahoo.com/d/quotes.html?s="&from&oto&"=X&f=sl1d1t1ba&e=.html" if from<>"" then ocontent=getHTTPPage2(url) ostr=split(ocontent,",") ohui=cdbl(ostr(1)) obuy=cdbl(ostr(4)) omai=cdbl(ostr(5)) otime=replace(replace(ostr(2),"""",""),"/","-")&" "&replace(ostr(3),"""","") dim db,conn,rs db = "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("data.mdb") set conn = server.createobject("adodb.connection") set rs = server.createobject("adodb.recordset") conn.open db set rs=server.CreateObject("ADODB.RecordSet") rs.Source="select * from otype where ocode='"&from&"'" rs.Open rs.Source,Conn,1,1 ofrom=rs("otype") rs.close set rs=nothing set rs=server.CreateObject("ADODB.RecordSet") rs.Source="select * from otype where ocode='"&oto&"'" rs.Open rs.Source,Conn,1,1 ooto=rs("otype") rs.close set rs=nothing Function GetHttpPage2(HttpUrl) If IsNull(HttpUrl)=True Or HttpUrl="$False$" Then GetHttpPage="$False$" Exit Function End If Dim Http Set Http=server.createobject("MSXML2.XMLHTTP") Http.open "GET",HttpUrl,False Http.setRequestHeader "User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" Http.Send() If Http.Readystate<>4 then Set Http=Nothing GetHttpPage2="$False$" Exit function End if GetHTTPPage2=bytesToBSTR(Http.responseBody,"GB2312") Set Http=Nothing If Err.number<>0 then Err.Clear End If End Function Function BytesToBstr(Body,Cset) Dim Objstream Set Objstream = Server.CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset BytesToBstr = objstream.ReadText objstream.Close set objstream = nothing End Function Content=Content&"| " & ofrom & " | " & vbNewLine Content=Content&"当前汇率 | " & vbNewLine Content=Content&"" & ooto & " | " & vbNewLine Content=Content&"汇率更新日期 | " & vbNewLine Content=Content&"买入 | " & vbNewLine Content=Content&"卖出 | " & vbNewLine Content=Content&"
| " & num & " | " & vbNewLine Content=Content&"" & ohui & " | " & vbNewLine Content=Content&"" & cint(num)*ohui & " | " & vbNewLine Content=Content&"" & otime & " | " & vbNewLine Content=Content&"" & obuy & " | " & vbNewLine Content=Content&"" & omai & " | " & vbNewLine Content=Content&"