RE: assembly security/permission question
- From: "David Thielen" <thielen@xxxxxxxxxxxxx>
- Date: Thu, 9 Jun 2005 07:27:03 -0700
No - my question is if I put
[assembly:
FileDialogPermission(SecurityAction.RequestRefuse,Unrestricted=true)]
in the assembly of a DLL, and that DLL has an event other DLLs subscribe to
- when that event fires does the above restriction stop the delegates in
other events from calling a FileDialog?
Because all I want to do in the assembly is say my dll does not call
FIleDialog - but that it is fine for other dlls that it calls via an event to
call it.
--
thanks - dave
""Peter Huang" [MSFT]" wrote:
> Hi
>
> Is this what you want?
>
> [DLL]
> [assembly:
> FileDialogPermission(SecurityAction.RequestRefuse,Unrestricted=true)]
> public class TestClass
> {
> public OpenFileDialog openFileDialog1 = new OpenFileDialog();
> public void ShowFileDialog()
> {
> openFileDialog1.ShowDialog();
> openFileDialog1.OpenFile(); //Failed due to security
> }
> }
>
> [Form client]
> TestClass tc = new TestClass();
>
> private void button1_Click(object sender, System.EventArgs e)
> {
> tc.ShowFileDialog();//failed
> }
> private void button2_Click(object sender, System.EventArgs e)
> {
> tc.openFileDialog1.ShowDialog();
> tc.openFileDialog1.OpenFile(); //Succeed.
> }
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
.
- Follow-Ups:
- RE: assembly security/permission question
- From: "Peter Huang" [MSFT]
- RE: assembly security/permission question
- References:
- assembly security/permission question
- From: David Thielen
- RE: assembly security/permission question
- From: "Peter Huang" [MSFT]
- assembly security/permission question
- Prev by Date: Re: SecurityException on GetTempFileName()
- Next by Date: Re: SecurityException on GetTempFileName()
- Previous by thread: RE: assembly security/permission question
- Next by thread: RE: assembly security/permission question
- Index(es):