namespace CodeAccessTest public partial class Form1 Form FileIOPermiss

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace CodeAccessTest
{
public partial class Form1 : Form
{
[FileIOPermission(SecurityAction.Demand, Unrestricted = true)]
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var d = new ClassLibrary2.Class1();
d.Test();
}
private void button2_Click(object sender, EventArgs e)
{
var d = new ClassLibrary1.Class1();
d.RemoteTest();
}
private void button3_Click(object sender, EventArgs e)
{
var d = new ClassLibrary1.Class1();
d.Test();
}
}
}