473,473 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

winform control hosted in IE, FileIO security exception. Please he

Moe
I have a winForm control that contains an openFileDialog.
I am using this control in a webForm by enbedding it using an <object> tag.
I need to access some information about the file on the client.
I strongly named my control assembly .
I created a machine level permission set, and assigned FileDialog, FileIO
and User interface permission.
I created a code group under all_Code, associated my assembly's strong name
to that group and assigned the permission set i created previously.

I also added the following attributes to my assembly:
[assembly:AllowPartiallyTrustedCallers]
[assembly: FileDialogPermission(SecurityAction.RequestMinimum , Unrestricted
= true)]
[assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted =
true)]
I am having a file IO Exception while trying to retreive the FileName
property of the openFileDialog.

Any help will be very appreciate it.

Thanks!
Nov 19 '05 #1
1 2090
when winForms controls are hosted in IE they run in a sandbox with reduced
permissions, no i/o allowed for instance.

to raise the permissions of the winform object:

1) supply a msi installer to install the object on the local machine, and
set the permissions. then you must reference the object from the gac not
your website

2) convience your users to trust your site, and up the permissions for
objects downloaded from your site (see caspol utility)

-- bruce (sqlwork.com)


"Moe" <Mo*@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
I have a winForm control that contains an openFileDialog.
I am using this control in a webForm by enbedding it using an <object>
tag.
I need to access some information about the file on the client.
I strongly named my control assembly .
I created a machine level permission set, and assigned FileDialog, FileIO
and User interface permission.
I created a code group under all_Code, associated my assembly's strong
name
to that group and assigned the permission set i created previously.

I also added the following attributes to my assembly:
[assembly:AllowPartiallyTrustedCallers]
[assembly: FileDialogPermission(SecurityAction.RequestMinimum ,
Unrestricted
= true)]
[assembly: UIPermission(SecurityAction.RequestMinimum, Unrestricted =
true)]
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted =
true)]
I am having a file IO Exception while trying to retreive the FileName
property of the openFileDialog.

Any help will be very appreciate it.

Thanks!

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: cgia | last post by:
I found out that only using winform I can use the winword interop and generate word document in the client machine and connect to a remote database, so that I have made a winform application which...
3
by: Neo | last post by:
I have a usercontrol that I am trying to use as an ActiveX Control on a WebPage, however it refereneces an Assembly that whenever the first call is made to anything in the Assembly a Security...
8
by: Sunil Menon | last post by:
Dear All, We are developing applications in ASP.Net...in one of our applications we would like to use a GridControl...we have tried to use a Server-Side Grid control but found the speed to be an...
5
by: Chris Podmore | last post by:
I have a problem with the Infragistics web controls on a hosted server. I get Security Exception errors. It appears that my site doesn’t have the correct privileges, how can I overcome the...
4
by: androoo | last post by:
Hi I have a windows control I embed onto an aspx page which is grabbing a dataset from the client and sending it to the server through a webservice. This works fine in a windows app. However...
0
by: terryrey | last post by:
Hi, I've got a winform control that is using Twain and which works fine in a windows application. I am now trying to get this hosted and running in IE6 for our intranet app but am running into...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
0
by: jwinkler2083233 | last post by:
I'm integrating some software from different vendors with a winform hosted in IE, so I don't have control over the source... Here are the symptoms: A Test program with a winform exe calling...
8
by: jporter188 | last post by:
Hello, I am working on a project to manipulate XML files. All of the files, the code, and the output are on network drives. When I run my program I get an exception (see below). I tried giving...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.