Hosting .NET Windows Forms Controls in IE
-
Hello!! I made a control which contains a RichTextBox and2 buttons. One button open a text file and the other save a text file: //---OPEN OpenFileDialog open = new OpenFileDialog(); open.Filter = "Text files (*.txt)|*.txt"; if (open.ShowDialog() == DialogResult.OK) richTextBox1.LoadFile(open.FileName); //---SAVE SaveFileDialog save = new SaveFileDialog(); save.Filter = "Text files (*.txt)|*.txt"; if (save.ShowDialog() == DialogResult.OK) richTextBox1.saveFile(save.FileName); And i want to host the control in Internet Explorer. Then i create an html file:
RichTextBox Control
And i Configure the Virtual Directory. I open the html page and i can see the control but when i want to open a text file an exception appears: System.Security.SecurityException: 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Also i configure the permissions in the .NET Framework 2.0 Configuration but the same exception appears. Somebody knows if i am missing something. Regards, Alberto Martinez
-
Hello!! I made a control which contains a RichTextBox and2 buttons. One button open a text file and the other save a text file: //---OPEN OpenFileDialog open = new OpenFileDialog(); open.Filter = "Text files (*.txt)|*.txt"; if (open.ShowDialog() == DialogResult.OK) richTextBox1.LoadFile(open.FileName); //---SAVE SaveFileDialog save = new SaveFileDialog(); save.Filter = "Text files (*.txt)|*.txt"; if (save.ShowDialog() == DialogResult.OK) richTextBox1.saveFile(save.FileName); And i want to host the control in Internet Explorer. Then i create an html file:
RichTextBox Control
And i Configure the Virtual Directory. I open the html page and i can see the control but when i want to open a text file an exception appears: System.Security.SecurityException: 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Also i configure the permissions in the .NET Framework 2.0 Configuration but the same exception appears. Somebody knows if i am missing something. Regards, Alberto Martinez