string ReferanceId ="HSA90232"; string basePath ="/Images/City/"; string PointQRCode ="PointQRCode"; string QrCode="3209323"; var url = string.Format("https://chart.googleapis.com/chart?cht=qr&chl=" + ReferanceId + "&chs=160x160&chld=L|0"); WebResponse response = default(WebResponse); Stream remoteStream = default(Stream); StreamReader readStream = default(StreamReader); WebRequest request = WebRequest.Create(url); response = request.GetResponse(); remoteStream = response.GetResponseStream(); readStream = new StreamReader(remoteStream); //Creating Path to save image in folder System.Drawing.Image img = System.Drawing.Image.FromStream(remoteStream); string imgpath = Path.Combine(System.Web.HttpContext.Current.Server.MapPath(basePath + PointQRCode), QrCode); var exists = System.IO.Directory.Exists(System.Web.HttpContext.Current.Server.MapPath(basePath + PointQRCode)); if (!exists) { System.IO.Directory.CreateDirectory(System.Web.HttpContext.Current.Server.MapPath(basePath + PointQRCode)); } img.Save(imgpath); //// Want to save Images from http://localhost:9634/ to http://localhost:3243/ it takes first one url response.Close(); remoteStream.Close(); readStream.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)