本文整理汇总了C#中Photo.WriteToFile方法的典型用法代码示例。如果您正苦于以下问题:C# Photo.WriteToFile方法的具体用法?C# Photo.WriteToFile怎么用?C# Photo.WriteToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo.WriteToFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Submit_Button_Click
protected void Submit_Button_Click(object sender, EventArgs e)
{
Users s = new Users();
Login l = new Login();
l.Email = email.Text;
l.Password = password.Text;
LoginController lc = new LoginController();
lc.addLogin(l);
s.Login_idLogin1 = lc.getLoginId(l);
s.Fname = fname.Text;
s.Mname = mname.Text;
s.Lname = lname.Text;
s.Dob = this.SelectedDate;
s.Gender = int.Parse(DropDownList1.SelectedValue);
s.A_line_1 = aline1.Text;
s.A_line_2 = aline2.Text;
s.A_line_3 = aline3.Text;
s.Contact_no = Int32.Parse(contact.Text);
// s.Photo=FileUpload.
if (FileUpload.FileName != null)
{
HttpPostedFile myFile = FileUpload.PostedFile;
int nFileLen = myFile.ContentLength;
byte[] myData = new byte[nFileLen];
myFile.InputStream.Read(myData, 0, nFileLen);
Photo p = new Photo();
p.WriteToFile(@"D:\" + milliseconds + "_image.jpg", myData);
}
else
{
// No file
}
s.Photo = @"D:\" + milliseconds + "_image.jpg";
fname.Text = s.Photo;
UserController uc = new UserController();
fname.Text = uc.addUserdata(s);
}