// involving namespace using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Web; using System.Configuration; // method public void AddUser (string PersonName, string PersonEmail, string PersonSex, string PersonDOB, string PersonImage, string PersonImageType) {string strImageType = userImage.PostedFile.ContentType; Stream ImageStream = userImage.PostedFile .Inputstream; // 加 水印 -----------------> string wimagefile = server.mappath ("/ bkwww / image / homesign.gif"); // To add watermark FIG Image sImage = Image.FromStream (ImageStream); // Create from the input stream Http image Image wImage = Image.FromFile (wImageFile); // drawing Graphics g = Graphics.FromImage (sImage); g.DrawImage (wImage, new Rectangle (0, 0, WiMage.width, Wimage.height), 0, 0, Wimage.Width, Wimage.Height, GraphicsUnit.pixel; // Save, translate Image to Byte [] MemoryStream MS = New MemoryStream () ; Byte [] MyImage = null; simage.save (MS, Imageform At.gif); MyImage = ms.getBuffer (); // ------------------------> // Write database string strConn = configurationSettings. AppSettings [ "ConnectionString"]; SqlConnection myConnection = new SqlConnection (strConn); SqlCommand myCommand = new SqlCommand ( "sp_person_isp", myConnection); myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.Add ( "@ PersonEmail", SqlDbType. VARCHAR, 255) .Value = personmail; mycommand.parameters.add ("@ personname", sqldbtype.varchar, 255) .value = personname; mycommand.parameters.add ("@ personsex", sqldbtype.char, 1); if (sexmale.checked) mycommand.parameters ["@