This chapter is a personnel management system, but there is no big difference between the technical aspects and system management.
The main point is: how to access images in. Net? Bitmap mypic;
Try
{
// Initializes a new bitmap instance from a specified file.
// For example, reading from an uploaded file is new Bitmap (file1.postedfile. inputstream)
Mypic = New Bitmap (lnkpic. SRC );
}
Catch (Exception ex)
{
Return ;
}
// Initializes a new bitmap class instance from a specified existing image and uses the specified size
Bitmap smallpic = New Bitmap (mypic, 100 , 100 );
// Create a buffer
Memorystream stream = New Memorystream ();
// Set write buffer in Image Format
Picsmall. Save (stream, imageformat. JPEG );
// Convert the buffer content to a byte array
Byte [] Bytearray = Stream. toarray ();
Photoaccess. updateemppic (empid, bytearray );
Display the image data in the database to the page, which can be achieved through the response output stream.
Response. contenttype = " Image/pjepg " ;
Response. outputstream. Write (( Byte []) Dr [ " PIC " ], 0 ,( Int ) Dr [ " Pic_size " ]);
Response. End ();
Use dataformatstring to set the display format strings of items in a specified Column
For example, formatting the time:
< ASP: boundcolumn Datafield = "Logindate" Headertext = "Logon Time" Dataformatstring = "{0: d }" > </ ASP: boundcolumn >