Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Hosting .NET Windows Forms Controls in IE

Hosting .NET Windows Forms Controls in IE

Scheduled Pinned Locked Moved C#
csharphtmldotnetwinformshosting
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JuanAlbertoMD
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • J JuanAlbertoMD

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Trust you havenot forgotton that Javascript and VBScript are unable to access your hard drive from a web page without using an Active X Control. Please read the ENTIRE thread starting with [^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups