// Upload the file <br/> string extension = path. getextension (uploadfile. postedfile. filename ). toupper (); <br/> string filename = datetime. now. year. tostring () + datetime. now. month. tostring () + datetime. now. day. tostring () + datetime. now. hour. tostring () + datetime. now. minute. tostring () + datetime. now. second. tostring (); <br/> string Path = server. mappath (". ") +"/uploadfile/"+ filename + extension; <br/> uploadfile. postedfile. saveas (PATH); <br/> // Add a text watermark. Note that the code here cannot coexist with the image watermark code below. <br/> system. drawing. image image = system. drawing. image. fromfile (PATH); <br/> graphics G = graphics. fromimage (image); <br/> G. drawimage (image, 0, 0, image. width, image. height); <br/> font F = new font ("verdana", 32); <br/> brush B = new solidbrush (color. white); <br/> string addtext = addtext. value. trim (); <br/> G. drawstring (addtext, F, B, 10, 10); <br/> G. dispose (); <br/> // Add an image watermark <br/> system. drawing. image image = system. drawing. image. fromfile (PATH); <br/> system. drawing. image copyimage = system. drawing. image. fromfile (server. mappath (". ") +"/alex.gif "); <br/> graphics G = graphics. fromimage (image); <br/> G. drawimage (copyimage, new rectangle (image. width-copyImage.Width, image. height-copyImage.Height, copyimage. width, copyimage. height), 0, 0, copyimage. width, copyimage. height, graphicsunit. pixel); <br/> G. dispose (); <br/> // Save the watermark image and delete the original image. <br/> string newpath = server. mappath (". ") +"/uploadfile/"+ filename +" _ new "+ extension; <br/> image. save (newpath); <br/> image. dispose (); <br/> If (file. exists (PATH) <br/>{< br/> file. delete (PATH); <br/>}< br/> response. redirect (newpath); <br/>