G
Guest
HI,
I'm trying to save an image that I download via a URL. The code below is
what I have so far, but I am getting stuck with saving it. I am using CF 1.1.
Any help would be appricated.
CODE STARTS HERE....
Dim objResult As WebResponse
Dim objRequest As WebRequest
objRequest = WebRequest.Create(strUrl)
objRequest.Timeout = 900000
objResult = objRequest.GetResponse
Dim objReceiveStream As Stream = objResult.GetResponseStream()
' BUILD FILENAME
Dim strFilename As String = Me.tbFileName.Text & "-" & intLoop & ".jpg"
' SAVE ITEM
Dim objFile As New FileStream(strFilename, FileMode.Create)
Dim intByte As Integer
Do
intByte = objReceiveStream.ReadByte
Loop Until intByte = -1
objFile.Close()
objReceiveStream.Close()
objResult.Close()
objRequest.Abort()
I'm trying to save an image that I download via a URL. The code below is
what I have so far, but I am getting stuck with saving it. I am using CF 1.1.
Any help would be appricated.
CODE STARTS HERE....
Dim objResult As WebResponse
Dim objRequest As WebRequest
objRequest = WebRequest.Create(strUrl)
objRequest.Timeout = 900000
objResult = objRequest.GetResponse
Dim objReceiveStream As Stream = objResult.GetResponseStream()
' BUILD FILENAME
Dim strFilename As String = Me.tbFileName.Text & "-" & intLoop & ".jpg"
' SAVE ITEM
Dim objFile As New FileStream(strFilename, FileMode.Create)
Dim intByte As Integer
Do
intByte = objReceiveStream.ReadByte
Loop Until intByte = -1
objFile.Close()
objReceiveStream.Close()
objResult.Close()
objRequest.Abort()