Alex's Weblog

Weblog di Ermanno Goletto (Codename Alex - A Learning EXperience)
posts - 438, comments - 4214, trackbacks - 294

My Links

News

Il blog è stato
trasferito al
 seguente link:


DevAdmin Blog

Add my blog to Live

Foto

Curriculum Vitae


Il contenuto di questo blog e di ciascun post viene fornito “così come é”, senza garanzie, e non conferisce alcun diritto. Questo blog riporta il mio personale pensiero che non riflette necessariamente il pensiero del mio datore di lavoro.

Logo Creative Commons Deed


Logo MCTS

Logo MCSA

Logo MCP

Logo Microsoft Certified Business Management Solutions Professional

Microsoft Certified Business Management Solutions Specialist


Logo UGIdotNET UGIdotNET Contributor


Logo UGISS UGISS Contributor


Logo SysAdmin.it SysAdmin.it Staff


Article Categories

Archives

Post Categories

Blogs

Database

Development

Friends

IT

Knowledge Base

Links

MBS

MCP

MVP Sites

User Groups

Virtualization

Scaricare un file da una pagina web

Private Sub DownloadFile(ByVal url As String, ByVal filePath As String)

     Dim webRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url)
     Dim webResponse As System.Net.WebResponse = webRequest.GetResponse()
    
Dim inputStream As System.IO.Stream = webResponse.GetResponseStream()

     Dim buffer(CInt(webResponse.ContentLength) - 1) As Byte
     inputStream.Read(buffer, 0, buffer.Length)

     inputStream.Close()
     webResponse.Close()
    
inputStream = Nothing
    
webResponse = Nothing
    
webRequest = Nothing

     Dim fileStream As New System.IO.FileStream(filePath, IO.FileMode.CreateNew)
    
Dim outputStream As New System.IO.BinaryWriter(fileStream)

     outputStream.Write(buffer)

     buffer = Nothing
    
outputStream.Close()
    
fileStream.Close()
    
outputStream = Nothing
    
fileStream = Nothing

End Sub

Print | posted on venerdì 18 novembre 2005 20:40 | Filed Under [ Code & Snippet .NET Framework ]

Feedback

Gravatar

# check cashing

Document was first pretty pleased to discover this approach awesome websites. I needed to make sure you with thanks to your effort therefore terrific look at! At this time follow-up check cashing Document undeniably really liked just than it and additionally I had you will book-marked read cutting edge matters upon your internet site
30/08/2017 22:56 | Pervez
Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET