URL 통신 샘플 코드

.NET 2008. 7. 16. 17:33


using System.Net;
using System.IO;
using System.Text;

    WebRequest wr = WebRequest.Create(txtURL.Text);
    WebResponse resp  = wr.GetResponse();
    //Bitmap willy = new Bitmap(resp.GetResponseStream());
    willy.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);
    //Stream stream = resp.GetResponseStream();
    //int fileSize = int.Parse(stream.Length.ToString());
    //Response.Write(stream.Length);
    //byte [] imgFile = new byte[1000];

    //stream.Read(imgFile,0,fileSize);

    //Response.BinaryWrite(imgFile);

AND