Openfiledialog

R

rob

Hi. I'm using a button to pop up an openfiledialog box in a infopath form.
After I select a file valid file on the dialogbox and click ok, I get the
following error message:

System.Security.SecurityException
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.IntSecurity.DemandFileIO(FileIOPermissionAccess
access, String fileName)
at System.Windows.Forms.FileDialog.get_FileName()
at DataUpload.DataUpload.btnBrowse_OnClick(DocActionEvent e) in D:\My
Projects\DataUpload\FormCode.vb:line 101
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

Seems like I cannot access files on the local hard drive. Maybe there's
something else I need to reference in the project? Thanks!
 
V

virgul

Hi,

You don't have the right to do that you need to have full trust or
domain trust to do your operation.

See on the msdn there are explanation and example about permission.

++

Thierry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top