cancel
Showing results for 
Search instead for 
Did you mean: 

Why this complier error display?

AkikoImai1
Level 3
Hi, I want to use printscreen, so I checked this link. https://portal.blueprism.com/global-send-keys-printscreen 1. Created an object. 2. Added "System.Windows.Forms.dll" at Initialise page, selected C# as language. 3. Added Data Item as filename and Code stage at Action page, then I wrote this code. SendKeys.Send("{PRTSC}"); dim Screenshot As Image = Clipboard.GetImage(); Screenshot.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg); But an error is displayed, I don't know why this error is displayed. "Compiler error ; is needed." # I attached the error. Could you please tell me how to clear this error? Thanks, Akiko
3 REPLIES 3

John__Carter
Staff
Staff
Your code isn't C#, it looks like VB.

Hi John, Thank you for your reply. I think so too, but I received another errors if I use VB. So I tried to use C#, and then there was this error only. Do you know how to write codes in this case (=using printscreen) ? Thanks, Akiko

Hi John, For reference your advice, the following code works for me! System.Windows.Forms.SendKeys.Send(""{PRTSC}"") dim Screenshot As Image = System.Windows.Forms.Clipboard.GetImage() Screenshot.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg) Thank you! Akiko