WinForms - Syntax for settings permissions
4 posts
• Page 1 of 1
WinForms - Syntax for settings permissions
Hello,
I'm working on a project using WinForms. I set up a WebBrowser component and I'm trying to set the security settings to get data from a webpage displayed in the component.
Unfortunately I got stuck on the syntax. Can you please advice what's the correct PHP Phalanger syntax for the following code?
---------------
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
...
The full code is at http://msdn.microsoft.com/cs-cz/library ... pting.aspx
Thank you
I'm working on a project using WinForms. I set up a WebBrowser component and I'm trying to set the security settings to get data from a webpage displayed in the component.
Unfortunately I got stuck on the syntax. Can you please advice what's the correct PHP Phalanger syntax for the following code?
---------------
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
...
The full code is at http://msdn.microsoft.com/cs-cz/library ... pting.aspx
Thank you
- paul.bentley
- Posts: 2
- Joined: June 24th, 2012, 9:22 am
Re: WinForms - Syntax for settings permissions
Hi,
thanks for the question!
I have to admit, I had to take a look into the parser to find out. However there is a small bug (because nobody ever who contacted us tried it before) The bug is fixed now; the fix will be pushed on github first, then into the upcoming release.
The syntax for your case is following:
It is very the same as in C#, just namespace and variable syntax as from PHP (\ instead of ., $Name instead of Name), and named parameters uses '=>' instead of '='. Of course you have to reference 'mscorlib' assembly.
thanks for the question!
I have to admit, I had to take a look into the parser to find out. However there is a small bug (because nobody ever who contacted us tried it before) The bug is fixed now; the fix will be pushed on github first, then into the upcoming release.
The syntax for your case is following:
- Code: Select all
use System\Security\Permissions;
[Permissions\PermissionSet(Permissions\SecurityAction::Demand, $Name=>"FullTrust")]
It is very the same as in C#, just namespace and variable syntax as from PHP (\ instead of ., $Name instead of Name), and named parameters uses '=>' instead of '='. Of course you have to reference 'mscorlib' assembly.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: WinForms - Syntax for settings permissions
Hi Jakub,
thank you very much for the very quick reply and bug fix.
I have one more bug to report. I'm currently using an older (March) release of Phalanger because there's a bug in the June one.
If you create a brand new project for Phalanger WinForms and you press F5, it displays an error message concerning incorrect classes (as far as I remember).
If you could have a look at it, it'd be great.
Thank you
thank you very much for the very quick reply and bug fix.
I have one more bug to report. I'm currently using an older (March) release of Phalanger because there's a bug in the June one.
If you create a brand new project for Phalanger WinForms and you press F5, it displays an error message concerning incorrect classes (as far as I remember).
If you could have a look at it, it'd be great.
Thank you
- paul.bentley
- Posts: 2
- Joined: June 24th, 2012, 9:22 am
Re: WinForms - Syntax for settings permissions
Thanks! The bug is replicable and has been added onto our todo list.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests