Why this complier error display?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-11-17 07:44 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-11-17 02:15 PM
Your code isn't C#, it looks like VB.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-17 08:46 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-11-17 08:56 AM
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
