SecurityException while Loading a File in a RichTextBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Schalx

    #1

    SecurityException while Loading a File in a RichTextBox

    As Newbie I don't know what's the error in this function. Allways and
    with any File I get a Security Exection:

    private void button3_Click(o bject sender, System.EventArg s e)
    {

    FileIOPermissio n f = new FileIOPermissio n(PermissionSta te.None);
    f.AllFiles = FileIOPermissio nAccess.AllAcce ss;

    if(openFileDial og1.ShowDialog( ) == DialogResult.OK )
    {
    richTextBox1.Lo adFile(openFile Dialog1.FileNam e,
    RichTextBoxStre amType.RichText );

    }
    }

    Thnaks for the answer.
Working...