document.getElementById("container").innerHTML = event.offsetX + "," + event.offsetY;
}
left: 0px;
bottom: 0px;
text-align: left;
width:293px;
background-repeat: no-repeat;
height: 190px;
}
usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Net;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Security.Cryptography.X509Certificates;usingSystem.Net.Security;namespace_0922w
{public partial classWebForm1 : System.Web.UI.Page
{static CookieContainer Cookies = newCookieContainer();staticHttpWebRequest myHttpWebRequest;protected void Page_Load(objectsender, EventArgs e)
{string oneUrl = "https://kyfw.12306.cn/otn/passcodeNew/getPassCodeNew?module=login&rand=sjrand";
myHttpWebRequest= (HttpWebRequest)WebRequest.Create(oneUrl);//请求的URL
myHttpWebRequest.CookieContainer = Cookies;//*发送COOKIE//if (Session["tzcooket"] != null)//myHttpWebRequest.Headers.Set("Set-Cookie", Session["tzcooket"].ToString());
myHttpWebRequest.Method = "GET";
myHttpWebRequest.ContentType= "application/x-www-form-urlencoded";//获取返回资源
HttpWebResponse response =(HttpWebResponse)myHttpWebRequest.GetResponse();
Stream responseStream=response.GetResponseStream();
System.Drawing.Image bitmapImage= System.Drawing.Bitmap.FromStream(responseStream) asSystem.Drawing.Image;string imgName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".jpg";
bitmapImage.Save("D:\\documents\\visual studio 2015\\Projects\\0922\\0922w\\image\\" +imgName, System.Drawing.Imaging.ImageFormat.Jpeg);//Image1.ImageUrl = "~/image/1152165471.jpg";
this.container.Style.Remove(HtmlTextWriterStyle.BackgroundImage);this.container.Style.Add(HtmlTextWriterStyle.BackgroundImage, "http://localhost:7520/image/" +imgName);
}
}
}