1

これは印刷用スクリーン、

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);

これをコントローラーに入れてみましたが、画面を何も認識しません。

これは取り付けるためのもので、

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

このようにファイルパスを追加することはできますか?: new System.Net.Mail.Attachment("filepath");

4

1 に答える 1

2

これは Windows コードであり、クライアント ブラウザーではなく WinForm で実行できます。

于 2011-10-02T15:40:46.327 に答える