ASP. NET Office Automation System Development Instance navigation Note 3 Personnel Management Module

Source: Internet
Author: User
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 >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.