K
kieran
Hi,
I am trying to download a file through a proxy which is causing me
lots of permission erors.
anyway after hacking at any and all code i could get my hands on, i
got this far, where the xml file is in the sLine stream. now i want
to save this stream to a local xml file but am having trouble doing
this.
<code>
Dim sURL As String
sURL = "http://test/rss.xml"
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)
Dim saByPassList() As String
Dim myProxy As New WebProxy("proxy:8080", True, saByPassList,
New NetworkCredential("user", "password", "_domain"))
myProxy.BypassProxyOnLocal = True
wrGETURL.Proxy = myProxy
'wrGETURL.Proxy = WebProxy.GetDefaultProxy()
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()
Dim objReader As New StreamReader(objStream)
Dim sLine As String = ""
Dim i As Integer = 0
Do While Not sLine Is Nothing
i += 1
sLine = objReader.ReadLine
If Not sLine Is Nothing Then
Console.WriteLine("{0}:{1}", i, sLine)
End If
Loop
Console.ReadLine()
</code>
Does anyone have any ideas for this.
I am trying to download a file through a proxy which is causing me
lots of permission erors.
anyway after hacking at any and all code i could get my hands on, i
got this far, where the xml file is in the sLine stream. now i want
to save this stream to a local xml file but am having trouble doing
this.
<code>
Dim sURL As String
sURL = "http://test/rss.xml"
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)
Dim saByPassList() As String
Dim myProxy As New WebProxy("proxy:8080", True, saByPassList,
New NetworkCredential("user", "password", "_domain"))
myProxy.BypassProxyOnLocal = True
wrGETURL.Proxy = myProxy
'wrGETURL.Proxy = WebProxy.GetDefaultProxy()
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()
Dim objReader As New StreamReader(objStream)
Dim sLine As String = ""
Dim i As Integer = 0
Do While Not sLine Is Nothing
i += 1
sLine = objReader.ReadLine
If Not sLine Is Nothing Then
Console.WriteLine("{0}:{1}", i, sLine)
End If
Loop
Console.ReadLine()
</code>
Does anyone have any ideas for this.