예제 #1
0
 public AtService(Attachment attachment, int questionId, int answerId)
 {
     this._attachment = attachment;
     this._questionId = questionId;
     this._answerId = answerId;
 }
예제 #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string fielname = FileUpload1.FileName;
            Stream fs = FileUpload1.PostedFile.InputStream;
            byte[] arr = new byte[fs.Length];
            fs.Read(arr, 0, arr.Length);
            Attachment atc = new Attachment
            {
                FileName = fielname,
                ImgArr = arr,
                Title = "alt"
            };

            AtService service = new AtService(atc, 0, 0);
            service.Save();
            Response.Write("uplaod suc.");
        }