Skip to content

Instantly share code, notes, and snippets.

@rodrigocnascimento
Created January 21, 2014 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigocnascimento/8547108 to your computer and use it in GitHub Desktop.
Save rodrigocnascimento/8547108 to your computer and use it in GitHub Desktop.
Gerando XML com ASP
'GERANDO XML ------------------------------------------------------------------------------------------------
ArquivoXML = "lance_a_lance.xml" 'adicionando um nome no arquivo
timestamp = DateAdd("h", 3, Time)
Set FSO = CreateObject("Scripting.FileSystemObject") 'criando o objeto FSO
Set Linhas = FSO.CreateTextFile(Server.MapPath(ArquivoXML), True) 'salvando o arquivo no servidor através do método "CreateTextFile"
'gerando linas
Linhas.WriteLine("<?xml version=""1.0""?>")
Linhas.WriteLine("<LANCE_A_LANCE>")
Linhas.WriteLine("<TEMPO_JOGO>"&titulo&"</TEMPO_JOGO>" )
Linhas.WriteLine("<MINUTO_JOGO>"&MINUTO&"</MINUTO_JOGO>" )
Linhas.WriteLine("<COMENTARIO>"&comentario&"</COMENTARIO>" )
Linhas.WriteLine("<TIMESTAMP>"&timestamp&"</TIMESTAMP>" )
Linhas.WriteLine("</LANCE_A_LANCE>")
'destruíndo os objetos
Linhas.Close
Set Linhas = Nothing
'------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment