Asp.net Learning

Source: Internet
Author: User
  //  Abstract:
// Displays a text box control and a browse button, allowing you to select the file to be uploaded to the server.
[Controlvalueproperty ( " Filebytes " )]
[Validationproperty (
" Filename " )]
[Designer (
" System. Web. UI. Design. webcontrols. previewcontroldesigner, system. Design, version = 2.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a " )]
Public Class Fileupload: webcontrol
{
// Abstract:
// Initialize a new instance of the system. Web. UI. webcontrols. fileupload class.
Public Fileupload ();

// Abstract:
// Obtain a byte array from the file specified by the system. Web. UI. webcontrols. fileupload control.
//
// Returned results:
// The system. byte array contains the content of the specified file.
//
// Exception:
// System. Web. httpexception:
// The entire file is not read.
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
[Browsable (
False )]
[Bindable (
True )]
Public Byte [] Filebytes { Get ;}
//
// Abstract:
// Obtain the system. Io. Stream object, which points to the file to be uploaded using the system. Web. UI. webcontrols. fileupload control.
//
// Returned results:
// System. Io. Stream, pointing to the File Uploaded using system. Web. UI. webcontrols. fileupload.
[Browsable ( False )]
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
Public Stream filecontent { Get ;}
//
// Abstract:
// Obtain the name of the file uploaded by the system. Web. UI. webcontrols. fileupload control on the client.
//
// Returned results:
// This string specifies the name of the file uploaded on the client using system. Web. UI. webcontrols. fileupload.
[Browsable ( False )]
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
Public String Filename { Get ;}
//
// Abstract:
// Gets a value that indicates whether the system. Web. UI. webcontrols. fileupload control contains files.
//
// Returned results:
// If system. Web. UI. webcontrols. fileupload contains a file, the value is true; otherwise, the value is false.
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
[Browsable (
False )]
Public Bool Hasfile { Get ;}
//
// Abstract:
// Obtain the basic system. Web. httppostedfile of the File Uploaded using the system. Web. UI. webcontrols. fileupload control.
// Object.
//
// Returned results:
// The system. Web. httppostedfile of the File Uploaded using system. Web. UI. webcontrols. fileupload.
[Browsable ( False )]
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
Public Httppostedfile postedfile { Get ;}

// Abstract:
// Add system. Web. UI. webcontrols. fileupload to the specified system. Web. UI. htmltextwriter object
// Controls to use HTML attributes and styles when rendering content.
//
// Parameters:
// Writer:
// System. Web. UI. htmltextwriter, which indicates the output stream of HTML content to be presented on the client.
Protected Override Void Addattributestorender (htmltextwriter writer );
//
// Abstract:
// For the system. Web. UI. webcontrols. fileupload control, the system. Web. UI. Control. prerender
// Event.
//
// Parameters:
// E:
// The system. eventargs object that contains event data.
Protected Internal Override Void Onprerender (eventargs E );
//
// Abstract:
// Send the content of the system. Web. UI. webcontrols. fileupload control to the specified system. Web. UI. htmltextwriter.
// Object, which is written to the content presented on the client.
//
// Parameters:
// Writer:
// System. Web. UI. htmltextwriter that receives the content of the system. Web. UI. webcontrols. fileupload Control
// Object.
Protected Internal Override Void Render (htmltextwriter writer );
//
// Abstract:
// Save the content of the uploaded file to the specified path on the Web server.
//
// Parameters:
// Filename:
// A string that specifies the complete path on the server for storing the uploaded file.
//
// Exception:
// System. Web. httpexception:
// Filename is not the complete path.
Public Void Saveas ( String Filename );
}

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.