NETITC
 


>> Navegação >> Tópico >> SubTópico
NomeTítulo Tópicos
Mauricio Junior
Dúvida iniciada: 11/11/2005 10:09:12 AM

ler artigos txt


Dúvida:   >l html < >l body <
>l table <
>l tr < >l td < Arquivo Texto >l
td < >l
tr <
>l TABLE BORDER=01 <
>l TR <
>l %
Const fsoLeitura = 1
Dim objFSO
'Instanciar o objeto FSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

'Abrir o arquivo texto
Dim objTextStream
Set objTextStream = objFSO.OpenTextFile("c:\a33q15.dat", fsoLeitura)

linha = replace(objTextStream.ReadAll, " & # 58;", ":")
linha = replace(linha, " & # 60;", " >l ")
linha = replace(linha, " & # 32;", " ")
linha = replace(linha, " & # 61;", "=")
linha = replace(linha, " & # 34;", "'")
linha = replace(linha, " & # 47;", "
")
linha = replace(linha, " & # 46;", ".")
linha = replace(linha, " & # 95;", "_")
linha = replace(linha, " & # 62;", " < ")
linha = replace(linha, " & # 39;", "'")

Set objTextStream = objFSO.OpenTextFile("C:\exemplo.txt", 2, True)
objTextStream.Write linha

'Fechar e inicializar os objetos
objTextStream.Close
Set objTextStream = Nothing
Set objFSO = Nothing
% <


Respostas Data Resposta: 11/11/2005 10:19:32 AM
Mauricio Junior Dim TextStream Dim S Dim File Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") Const OpenFileForReading = 1
Const OpenFileForWriting = 2 ' Primeiro Modo Set TextStream = FSO.OpenTextFile("Teste.txt", OpenFileForReading) S =
TextStream.ReadAll & NewLine & NewLine TextStream.Close ' Segundo Modo Set File = FSO.GetFile("Teste.txt") Set TextStream =
File.OpenAsTextStream(OpenFileForReading) Do While Not TextStream.AtEndOfStream S = S & TextStream.ReadLine & NewLine Loop
TextStream.Close http://www.w3schools.com/asp/asp_ref_filesystem.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/sgprogrammingfilesystemobject.aspAlex

NETITC


Vídeos

 
Curso de C#


Visto por 41 pessoas.

Vídeo: Gerando Hash com .NET


Visto por 907 pessoas.

Criptografia para ser usada na URL


Visto por 1234 pessoas.

Mudar o toque do iPhone


Visto por 1779 pessoas.

12345678