using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.Web.ui.htmlcontrols;
Namespace CommonFunction {/// /// smallimg's summary description. /// summary> public class smallImg: System.Web.UI.Page {protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI. WebControls.Label Label3; protected System.Web.UI.WebControls.Button btnUp; protected System.Web.UI.WebControls.Image imageSource; protected System.Web.UI.WebControls.Image imageSmall; protected System.Web.UI.HtmlControls. HtmlInputFile upImage; // definition of the object image classes System.Drawing.Image image, newimage; // image path protected string imagePath; // picture type protected string imageType; // image Title protected string imageName; // a callback method, Used to determine when the image object is executed when performing a thumbnail operation // If this method determines that the getthumbnailimage method should stop execution in advance; otherwise return false system.drawing.image.getthumbnailimageAbort callb = null;
Private void Page_load (Object Sender, System.EventArgs E) {// Place user code here to initialize page}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} /// /// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// summary> private () {this.btnup.click = new system.eventhandler (this.btnup_click); this.load = new system.eventhandler (this.page_load);
} #Endregion
Private void btnup_click (object sender, system.eventargs e) {string mpath;
IF ("! = Upimage.postedFile.FileName) {imagePath = Upimage.postedFile.FileName; // Number Image Type ImageType = ImagePath.Substring (". ") 1); // Name Name ImageName = ImagePath.Substring ("//") 1); // Judgment is a JPG or GIF picture, just give an example, not necessarily these two picture IF ("jpg"! = ImageType && "GIF"! = imagetype) {response.write ("