C # Implementation To download the picture to the server code
ASPX page code:
<%@ Page language= "C #" autoeventwireup= true "codebehind=" GetPictureByUrl.aspx.cs "inherits=" Hovertreemobile.getpicturebyurl "%>
<! DOCTYPE html>
CS Page Code:
Using System;
Namespace Hovertreemobile
{public
partial class GetPictureByUrl:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
}
protected void Btnimg_click (object sender, EventArgs e)
{
try
{
System.Net.WebClient m_hvtwebclient = new System.Net.WebClient ();
String m_keleyipicture = Server.MapPath ("/hovertreeimages/keleyi.jpg");
Download files according to
the URL m_hvtwebclient.downloadfile (textboximgurl.text, m_keleyipicture);
Hvtimg.imageurl = "/hovertreeimages/keleyi.jpg";
Ltltips.text = string. Empty;
}
catch (Exception ex)
{
Ltltips.text = ex. ToString ();}}}
Also share the idea of the core method of downloading pictures
Using System.Net;
WebClient myclient = new WebClient ();
MyClient. DownloadFile ("Yun_qi_img/sslm_logo.gif", @ "C:\baidu.gif");
The address in the DownloadFile method is the URL on the remote server you want to spell.
Well, the small partners have a new understanding of it, I hope you can enjoy.