C
charlie tomson
hi..
After downloading cab file from webserver to pda
(ce.net4.1), the cabfile can't open in pda. why..
(same file works when transfer through active sync)
cab file size in pc 109k, but in pda 111k. why..
following code is used..
please let me know...
-----------------------------------------------------------
Dim objWebRequest As WebRequest
Dim objWebResponse As WebResponse
Dim objFileStream As FileStream
'Dim objBufferedStream As bufferedstream
Dim cabFileWriter As BinaryWriter
Dim cabFileReader As BinaryReader
Dim bArray(1024) As Byte
Dim fileSize As Long
Dim iRead As Integer = 1
Dim iCount As Integer
objWebRequest =
WebRequest.Create"http://211.38.77.42/tmp/cabtest.cab")
cabFileReader = New BinaryReader
(objWebResponse.GetResponseStream)
objFileStream = New FileStream
("\temp\cabtest.cab",FileMode.OpenOrCreate,FileAccess.Write
)
fileSize = objWebResponse.ContentLength()
While iRead > 0
iRead = cabFileReader.Read(bArray, 0, bArray.Length)
objFileStream.Write(bArray, 0, bArray.Length)
End While
MsgBox("download completed")
cabFileReader.Close()
objFileStream.Close()
After downloading cab file from webserver to pda
(ce.net4.1), the cabfile can't open in pda. why..
(same file works when transfer through active sync)
cab file size in pc 109k, but in pda 111k. why..
following code is used..
please let me know...
-----------------------------------------------------------
Dim objWebRequest As WebRequest
Dim objWebResponse As WebResponse
Dim objFileStream As FileStream
'Dim objBufferedStream As bufferedstream
Dim cabFileWriter As BinaryWriter
Dim cabFileReader As BinaryReader
Dim bArray(1024) As Byte
Dim fileSize As Long
Dim iRead As Integer = 1
Dim iCount As Integer
objWebRequest =
WebRequest.Create"http://211.38.77.42/tmp/cabtest.cab")
cabFileReader = New BinaryReader
(objWebResponse.GetResponseStream)
objFileStream = New FileStream
("\temp\cabtest.cab",FileMode.OpenOrCreate,FileAccess.Write
)
fileSize = objWebResponse.ContentLength()
While iRead > 0
iRead = cabFileReader.Read(bArray, 0, bArray.Length)
objFileStream.Write(bArray, 0, bArray.Length)
End While
MsgBox("download completed")
cabFileReader.Close()
objFileStream.Close()