1

This is for printing screen,

using System.Drawing;
using System.Drawing.Imaging;
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

        Graphics graphics = Graphics.FromImage(printscreen as Image);

        graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);

        printscreen.Save(@"filepath", ImageFormat.Jpeg);

I tried putting this in my controller but it does not recognize Screen as anything.

This is for attaching,

System.Net.Mail.Attachment attachment;
            attachment = new System.Net.Mail.Attachment("you attachment file");
            mMailMessage.Attachments.Add(attachment);

Can I just add the filepath like this?: new System.Net.Mail.Attachment("filepath");

AugustusWee
  • 67
  • 2
  • 9
  • 1
    Is this ASP.NET? Do you understand the difference between server side and client side code? – Jason Oct 02 '11 at 15:43

1 Answers1

2

It's a Windows code and can run on WinForm not on client browser.

Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70