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