The front page is like this:
<%--Photo Gallery 20140705add--%>
<div id= "Imgshowdiv" style= "left:550px; top:90px; height:430px; Display:none; "class=" MsgBoxStyle ">
<a id= "A1" onclick= "Closedlg (This)" href= "#" class= "Iclose" title= "Close or hide" ></a>
<div style= "top:30px; Position:absolute; " >
<a href= "" target= "_blank" id= "Atp_yyzz" >
</a>
</div>
</div>
The associated JS is: Drag_layer.js and imgshowfuncs.js, in addition to referencing a imagezoom.css style file
Click on the picture when the new page opens the original image but the path will be error, so I added the first sentence in the Pageload solution:
request.contentencoding = System.Text.Encoding.GetEncoding ("GB2312");
string args = request.params["args"]. ToString ();
string imgpath = args;
System.IO.FileStream afile = new System.IO.FileStream (Imgpath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
Create a binary data stream reader, and open file associations
System.IO.BinaryReader brmyfile = new System.IO.BinaryReader (afile);
Reposition the file pointer to the beginning of the file
BrMyfile.BaseStream.Seek (0, System.IO.SeekOrigin.Begin);
Get a byte array of photos
byte[] photo = Brmyfile.readbytes (Convert.ToInt32 (aFile.Length.ToString ()));
Close each of these new objects
Brmyfile.close ();
Response.BinaryWrite (photo);
The problem is to request or return when the encoding method is not correct, write code when more attention, problems more analysis can be.