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. 2 1535
Hi,
Did you try something like this?
Dim dsXML As New DataSet
dsXML.ReadXml("http://msdn.microsoft.com/rss.xml")
dsXML.WriteXml("rss.xml")
Ken
---------------------
"kieran" <ki********@hotmail.com> wrote in message
news:b3*************************@posting.google.co m: 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.
--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus ( http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004
Cheers for response Ken.
That would work fine only for the proxy i have to go through so i
would need to feed the proxy and network credentials into the dataset
connection.
I have tried doing this but can't get it to work. Is this possible
using the code.
i am a newbie so am probably completely off track. I would greatly
appreciate if you could simply explain how to do this, or point me to
a good tutorial.
Cheers for help.
Ken Tucker [MVP] <vb***@bellsouth.net> wrote in message news:<uz**************@TK2MSFTNGP12.phx.gbl>... Hi,
Did you try something like this?
Dim dsXML As New DataSet dsXML.ReadXml("http://msdn.microsoft.com/rss.xml") dsXML.WriteXml("rss.xml")
Ken --------------------- "kieran" <ki********@hotmail.com> wrote in message news:b3*************************@posting.google.co m: 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: gnv |
last post by:
Hi all,
I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript
program to save an XML file to local file system.
I have an xml string like below:
var xmlStr = "<?xml version="1.0"...
|
by: a |
last post by:
Save text file as html kloepper 17:42 23 Jul '04
I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
|
by: kevin |
last post by:
Hi,
Any help with this would be really appreciated!
I'm trying to download a file from a remote server. The access
permissions is okay but the problem I'm facing is that the file is
getting...
|
by: Ivan Demkovitch |
last post by:
Hi!
I would like to know if I can save File on Server using server-side code?
For example, I like to create thumbnail images and populate specific
directory.
Do I need specific permissions...
|
by: SveinErik |
last post by:
Hi, I'm trying to find a method to save bmp, jpg and png files as ico
files, 16x16 size. I have managed to convert and save bmp files to
icon, but only in 32x32 size. I can't figure out how to save...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |