<%
'instanciando objeto
Set objxml = Server.CreateObject("Microsoft.XMLHTTP")
'abrindo pagina
objxml.open "GET", "http://www.investshop.com.br/mer/include/Dolar.csv", false
objxml.send()
cotacao = objxml.ResponseText
cotacoes = replace(cotacao,"Nome;Compra;Venda;Variacao","") ' Tira a primeira parte que eh lixo
' Coloca Valores em uma Array
Dim valores()
Dim cont, cont_valores
For cont = 1 To Len(cotacoes) Step 1
If (mid(cotacoes,cont,1) = ";") Or (mid(cotacoes,cont,1) = " ") Or (mid(cotacoes,cont,1) = Chr(10)) Then
cont_valores = cont_valores + 1
Redim Preserve valores(cont_valores)
valores(cont_valores) = Cstr(str)
str = ""
Else
str = str + mid(cotacoes,cont,1)
End If
next
' Fim Coloca valores em uma Array
' Coloca os valores nas variaveis
DOLAR_COMERCIAL_COMPRA = valores(3)
DOLAR_COMERCIAL_VENDA = valores(4)
DOLAR_COMERCIAL_VARIACAO = valores(5)
DOLAR_PARALELO_COMPRA = valores(7)
DOLAR_PARALELO_VENDA = valores(8)
DOLAR_PARALELO_VARIACAO = valores(9)
DOLAR_TURISMO_COMPRA = valores(11)
DOLAR_TURISMO_VENDA = valores(12)
DOLAR_TURISMO_VARIACAO = valores(13)
' Fim coloca os valores nas variaveis
'Destruindo o Objeto ASPHTTP
Set HttpObj = Nothing
response.Write("dolar comercial compra:")
response.Write(DOLAR_COMERCIAL_COMPRA &"<br />")
response.Write("dolar comercial venda:")
response.Write(DOLAR_COMERCIAL_VENDA &"<br />")
response.Write("dolar paralelo compra:")
response.Write(DOLAR_PARALELO_COMPRA &"<br />")
response.Write("dolar paralelo venda:")
response.Write(DOLAR_PARALELO_VENDA &"<br />")
response.Write("dolar turismo compra:")
response.Write(DOLAR_TURISMO_COMPRA &"<br />")
response.Write("dolar turismo venda:")
response.Write(DOLAR_TURISMO_VENDA &"<br />")
%>
Publicidade
|
|
Page 1 of 1
Cotaçãos do dolar
#1
Posted 04 October 2011 - 10:14 AM
Share this topic:
Page 1 of 1
Similar Topics
| Topic | Forum | Started By | Stats | Last Post Info | |
|---|---|---|---|---|---|
|
Governo define escolas que vão testar laptops de 100 dólares
|
Notícias |
Notícias
|
|
|
|
ONG começa a produzir "ex-laptop de cem dólares"
|
Notícias |
Notícias
|
|
|
|
Dolar...
dolar e tempo da cidade |
Web Standards |
Renan Azevedo
|
|
|
|
Erramos: ONG começa a produzir "ex-laptop de cem dólares"
|
Notícias |
Notícias
|
|
|
|
Cotação do Dolar
Como colocar no site a cotação diária ? |
Dreamweaver |
Waldecleber
|
|
|
|
Oracle busca bilhões de dólares em processo contra Google
|
Notícias |
Notícias
|
|
|
|
Jovens dos EUA gastam milhares de dólares com SMS
|
Notícias |
Notícias
|
|
|
|
iTunes Store é lançada no Brasil com preços em dólar
|
Notícias |
Notícias
|
|
Publicidade
|
|

Help













