English 中文(简体)
c# converting HTML to JPG
原标题:
  • 时间:2009-11-25 14:29:35
  •  标签:
  • html
  • jpeg

I am trying to download image from HTTP URL to my computer via c#. Example picture: http://www.hcs.harvard.edu/csharp/Logo1.png

I am using cURL to fletch it. Then I am saving it to computer as picture.jpg, but the file is corrupted. It is not recognized as picture

What is the correct way of doing this ?

Thanks

最佳回答

Why not use System.Net.WebClient for this?

WebClient client = new WebClient();
client.DownloadFile("http://www.hcs.harvard.edu/csharp/Logo1.png", "Logo1.png");
问题回答

I don t completely understand the question, but my first thought is that saving a .png as .jpeg would be a good place to start investigating.

Have you tried saving it as picture.png?





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签