Public Function VeriAl(strGelen)

Set objVeriAl = Server.CreateObject(”Microsoft.XMLHTTP” )

objVeriAl.Open “GET” , strGelen, FALSE

objVeriAl.sEnd

VeriAl = objVeriAl.Responsetext

SET objVeriAl = Nothing

End Function

strAdres = “http://www.tcmb.gov.tr/kurlar/today.html”

strVeri = VeriAL(strAdres)

iDolar=InStr(strVeri,”USD” )

strDolarAlis=Mid(strVeri,iDolar+39,10)

strDolarSatis=Mid(strVeri,iDolar+52,10)

iEuro=InStr(strVeri,”EUR” )

strEuroAlis=Mid(strVeri,iEuro+39,11) ‘alis

strEuroSatis=Mid(strVeri,iEuro+52,11) ’satis

%>

Döviz kurlarının görünmesini istediğiniz yere aşağıdaki kodları yazın.

<%=strdolarsatis%>

Posted in Xml ve Asp | No Comments »

Dom Document Object Model aciliminin kisaltilmistir halidir ve HTML ya da XML dökümanlarini Obje ile calismaya yarar. Dom ayni zamanda bir W3C standartidir.  Örnek vericek olursak örnegin aspveasp.net sitesinde bir XML sayfasi oldugunu ve sizinde bunu okumaniz gerektigini düsünelim ;

 <?xml version=”1.0″ encoding=”Windows-1252″?>
 <articles>
 <article>
 <title><![CDATA[Tarih degerlerinde problem]]></title>
 <author><![CDATA[Mustafa Sahin]]></author>
 <url><![CDATA[http://www.aspveasp.net]]></url>
 <date><![CDATA[13.4.2008]]></date>
 <description><![CDATA[XML DOM DENEMESI.]]></description>
 </article>
 ….

 

Simdide Okuma Dom ile okuma islemine gelelim ,

 

<% @LANGUAGE = VBScript %>
<html>
<head>
<title>XML DOSYASINI OKUMA</title>
</head>
<body bgcolor=”#ffffff”>
<%
  Dim XMLDoc, rootNode, item
  Set XMLDoc = Server.CreateObject(”Microsoft.XMLDOM”)
  XMLDoc.async = False
  bLoadSuccess = XMLDoc.load(Server.MapPath(http://aspveasp.net/test.xml))
  If Not bLoadSuccess Then
  Response.Write “Could not load the XML document!”
  Else
Set rootNode = XMLDoc.documentElement
strOut = OutputNode(rootNode,1)
Response.Write “<PRE>” & vbCrlf
Response.Write strOut
Response.Write “</PRE>” & vbCrlf
  End If

  Function OutputNode(ByVal node, ByVal nDepth)
   strPadding = Space(nDepth)
   strOutput = strOutput & strPadding & “<” & node.nodeName & _
“>” & vbCrLf
   For Each item in node.childNodes
    If item.hasChildNodes() Then
      strOutPut = strOutput & OutputNode(item,nDepth+1)
    Else
      strOutput = strOutput & strPadding & “<” & item.nodeName & “>”
      strOutput = strOutput & item.Text
      strOutput = strOutput & “</” & item.nodename & “>” & vbCrLf
    End If
   Next
   strOutput = strOutput & strPadding & “</” & node.nodeName & _
“>” & vbCrLf
  OutputNode = strOutput
  End Function
%>
</body>
</html>

 </articles>

Posted in Xml ve Asp | No Comments »

Asp ve Xml kullanarak domain adi bos mu degil mi sorgulayip kontrol edelim . Her nekadar bu sorgulama sistemi %100 güvenli olmasada cogu zaman Asp de kullanabilinecek en hizli ve pratik uygulamali Domain kontrol sekillerinden biridir. Daha ilerki yazilarimda daha güvenilir Whois sorgularida yazmaya calisacagim .

<%
If  request.form(”domain”)<>”"  thenÂ
 GotothisURL = “http://www.” & request.form(”domain”)

  Set  GetConnection = CreateObject(”Microsoft.XMLHTTP”)

 GetConnection.Open “get”, GotothisURL,  FalseÂ
on error resume  nextÂ
 GetConnection.Send 

 ResponsePage = GetConnection.getResponseHeader(”Date”)

if  ResponsePage=”"  then Â
Response.write(”Domain kullanımda deÄŸil”)
elseÂ
Response.write(”Domain alınmış(kullanımda)”)
end  if

Set  GetConnection =  Nothing 

elseÂ
%>
<form method=post action=<% =request.servervariables(”URL”) %>>
<input type=text name=domain size=15 value=”domain.com”>
<input type=submit value=”Find domain name”>
</form>
<%  end  if %>

Posted in Xml ve Asp | No Comments »

Kategoriler

Arsivler

Baglantilar

Site ici Arama

Meta: