Control | Upload always use someone else's control, the first time you want to write a control. Then wrote a simple small control, mainly for their own learning and other want to try to write the control of friends, please advise.
The main role of the control is to upload the local picture to the custom directory.
Using System;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.ComponentModel;
Using System.Web.UI.HtmlControls;
Using System.IO;
Namespace Uploadimage
{
<summary>
Author: Darkangel 2004-10-27 Day of Creation
Support image upload to server function
</summary>
[Defaultproperty ("Text"),
ToolBoxData (@ "<{0}:upimage runat=server></{0}:upimage>")]
public class Upimage:control, INamingContainer
{
protected int filelength;
protected string ImageUrl;
protected string mydirectory;
static string Logourl;
protected string vpicture;
Public Button MyButton;
Public HtmlInputFile FileUpload;
Public Label Label1;
Public Upimage ()
{
This. EnsureChildControls ();
}
[Bindable (True),
Category ("appearance"),
DefaultValue ("")]
[
DescriptionAttribute ("File Size")
]
public int Filelength
{
Set{filelength=value;}
Get{return Filelength;}
}
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.