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. OpenFileDialog in Web...

OpenFileDialog in Web...

Scheduled Pinned Locked Moved C#
csharpwinformsquestionasp-nethosting
3 Posts 3 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.
  • C Offline
    C Offline
    Chetan Ranpariya
    wrote on last edited by
    #1

    Hi Friends, I dont know in which section should I post this question coz it related to both C# and ASP.NET. I have very strange requirment. I our project we developed our application in windows forms project. The project contains a bunch of class libraries and number of windows usercontrol libraries. Now we are hosting those user controls to the web. Everything is working fine till the control with FileOpenDialog in it comes in picture. When that user control opens in web it throws the followin exception. "Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator, or use the microsoft .net frameword configuration tool. Request for permission type 'system.security.permissions.fileiopermission, mscorlib, version=2.0.0.0, Cultrue=neutral, pulickeytoken=xxxsdlff' failed." I know the reason why this exception is coming. what I want to know is , is there any work aroud of this problem except using asp.net "file" control? Thank you all in advance. Thanks and regards, Chetan Ranpariya

    Thanks and Regards, Chetan Ranpariya

    L M 2 Replies Last reply
    0
    • C Chetan Ranpariya

      Hi Friends, I dont know in which section should I post this question coz it related to both C# and ASP.NET. I have very strange requirment. I our project we developed our application in windows forms project. The project contains a bunch of class libraries and number of windows usercontrol libraries. Now we are hosting those user controls to the web. Everything is working fine till the control with FileOpenDialog in it comes in picture. When that user control opens in web it throws the followin exception. "Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator, or use the microsoft .net frameword configuration tool. Request for permission type 'system.security.permissions.fileiopermission, mscorlib, version=2.0.0.0, Cultrue=neutral, pulickeytoken=xxxsdlff' failed." I know the reason why this exception is coming. what I want to know is , is there any work aroud of this problem except using asp.net "file" control? Thank you all in advance. Thanks and regards, Chetan Ranpariya

      Thanks and Regards, Chetan Ranpariya

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Is the web app running under full trust?

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 alpha 4 out now (27 May 2008)

      1 Reply Last reply
      0
      • C Chetan Ranpariya

        Hi Friends, I dont know in which section should I post this question coz it related to both C# and ASP.NET. I have very strange requirment. I our project we developed our application in windows forms project. The project contains a bunch of class libraries and number of windows usercontrol libraries. Now we are hosting those user controls to the web. Everything is working fine till the control with FileOpenDialog in it comes in picture. When that user control opens in web it throws the followin exception. "Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator, or use the microsoft .net frameword configuration tool. Request for permission type 'system.security.permissions.fileiopermission, mscorlib, version=2.0.0.0, Cultrue=neutral, pulickeytoken=xxxsdlff' failed." I know the reason why this exception is coming. what I want to know is , is there any work aroud of this problem except using asp.net "file" control? Thank you all in advance. Thanks and regards, Chetan Ranpariya

        Thanks and Regards, Chetan Ranpariya

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        Do you mean that you're using Windows Forms controls in a webpage, where the control is downloaded to the browser? Those controls run in a security sandbox, to prevent them from damaging the rest of the system (this is the same as Java applets). The CLR enforces this security sandbox by preventing code from being loaded that would violate the security policy. One of the things that remote code is not allowed to do is open arbitrary files directly using the

        FileStream

        class or its derivatives. You can generally, however, open files via an

        OpenFileDialog

        , if you use the

        OpenFile

        method of the dialog object. You cannot find out the filename using the

        FileName

        property. The .NET Framework security set is quite granular. The exact permissions to perform a task are generally listed at the bottom of the documentation. You can find the list of defaults at Default Security Policy[^]. Your code, if running in a web page, will come under the Local Intranet zone if on the local network (and, in IE 7.0, the computer is on an Active Directory domain) and under Internet if on a different network.

        DoEvents: Generating unexpected recursion since 1991

        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