c# - How to read xml file and save using httprequest and response -


Exact Duplicate of


Hi guys hope everyone is doing well I have got some suggestions about this question, but how to implement is illusion, anyone can help implement it so that the problem can be solved. Try it as

  string = string = string = "http: // xyz". HttpWebRequest = CType (WebRequest.Create (strUrl) HttpWebRequest) HttpWebResponse = CType (wr.GetResponse (), HttpWebResponse) ws.ContentType = "UTF-8" stream as dim str = ws.GetResponseStream () Dim inBuf (100000) Such as byte dim bytes = integer = CINT InBuf.Length) Read the dim bytes as integers = 0 while the bytes read & gt; Exact = str.Read (inBuf, bytesRead, bytesToRead) as 0mn n, if n = 0, then exit bytes byte + = n bytes reader - = n and while the new file stream ("c: / GetXml. Xml "as fist FileMode.OpenOrCreate, FileAccess.Write) fstr.Write (inBuf, 0, bytes read) str.Close () fstr.Close () as WebException Response.Write (ex.Message) End Try  

I got the suggestion

  public static zero copy stream (stream input, stream output) {byte [buffer = new byte [8192]; Int bytes read; While ((BytesRed = Input Reed (buffer, 0, buffer length))> gt; {output. (Buffer, 0, bytes read); Thanks in advance.   

< Div class = "post-text" itemprop = "text">

Before I answered your question () - what is not good about the approach of this suggestion ??

#, But you should not have any problem in changing VB.Net:

  WebClient Wc = new WebClient (); Wc.DownloadFile ("http: // xyz", @ " C: \ getxml.xml ");  

And you have done it!

Do not ask Sn repeatedly and repeatedly - wait for an answer, read the reply.>

Mark


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -