Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.IO;
  8.  
  9. public partial class ImageConversions : System.Web.UI.Page
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. CreatePhoto();
  14. }
  15.  
  16. void CreatePhoto()
  17. {
  18. try
  19. {
  20.  
  21. string strPhoto = Request.Form["imageData"]; //Get the image from flash file
  22. byte[] photo = Convert.FromBase64String(strPhoto);
  23.  
  24.  
  25.  
  26. FileStream fs = new FileStream("C:\Webcam.jpg", FileMode.OpenOrCreate, FileAccess.Write);
  27. BinaryWriter br = new BinaryWriter(fs);
  28. br.Write(photo);
  29. br.Flush();
  30. br.Close();
  31. fs.Close();
  32. }
  33. catch (Exception Ex)
  34. {
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement