473,698 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about embedded winform controls

Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")

Dim fileinfo() As FileInfo = dirinfo.GetFile s

Dim fi As FileInfo

For Each fi In fileinfo

TreeView2.Nodes .Add(fi.Name)

Next

If instead of adding nodes to a treeview, i throw in a response.write the following works perfectly fine in an aspx page. However, the same code in an embedded windows control causes the component to not load.

everything else in the component will load if i take that out and throw in random values. I suspect this is a security issue but the fact that it works in an aspx page is throwing me off. Currently i am putting the dll into the directory of the page, will it make any difference if i add it to the GAC? I am so close to something really beautiful. any insight would be appreciated.

Thanks

Steve

Nov 18 '05 #1
5 1575
You cannot acces the local filesystem from an embedded windows user control.
That is a security issue. Downloaded assemblies are placed in the download
cache and from there, they cannot access local resources (file system, db,
printer,...).

You can change the security policy for the assembly that you download. This
can be done in the Microsoft .NET Framework 1.1 Configuration console or the
Microsoft .NET Framework 1.1 Wizards. These can be found in the Administrive
tools window. There you can trust the assembly you want to use in the
browser. Not that this has to be done for every client machine that uses
this control.

I don't know if this was the answer you were looking for.
Regards.
Kristof


"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")
Dim fileinfo() As FileInfo = dirinfo.GetFile s
Dim fi As FileInfo
For Each fi In fileinfo
TreeView2.Nodes .Add(fi.Name)
Next
If instead of adding nodes to a treeview, i throw in a response.write the
following works perfectly fine in an aspx page. However, the same code in an
embedded windows control causes the component to not load.
everything else in the component will load if i take that out and throw in
random values. I suspect this is a security issue but the fact that it works
in an aspx page is throwing me off. Currently i am putting the dll into the
directory of the page, will it make any difference if i add it to the GAC? I
am so close to something really beautiful. any insight would be appreciated.

Thanks

Steve
Nov 18 '05 #2
perhaps this will help you fill that treeview of yours, it worked great for
me. There should be a vb sample you can download.

http://www.csharpfriends.com/Article...?articleID=109

"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")
Dim fileinfo() As FileInfo = dirinfo.GetFile s
Dim fi As FileInfo
For Each fi In fileinfo
TreeView2.Nodes .Add(fi.Name)
Next
If instead of adding nodes to a treeview, i throw in a response.write the
following works perfectly fine in an aspx page. However, the same code in an
embedded windows control causes the component to not load.
everything else in the component will load if i take that out and throw in
random values. I suspect this is a security issue but the fact that it works
in an aspx page is throwing me off. Currently i am putting the dll into the
directory of the page, will it make any difference if i add it to the GAC? I
am so close to something really beautiful. any insight would be appreciated.

Thanks

Steve
Nov 18 '05 #3
Kristof,

Thanks, this is exactly the answer i was looking for. What if, let's say, a
user didn't go to 2003 (because whidbey was all ready on the horizon and is
promising to not rewrite my code) and is still using the original. Is there
work arounds that do the same thing for 1.0?

thanks a ton for your time

Steve

"Kristof Van Praet" <kr************ **@hotmail.com> wrote in message
news:eB******** ******@TK2MSFTN GP09.phx.gbl...
You cannot acces the local filesystem from an embedded windows user control. That is a security issue. Downloaded assemblies are placed in the download
cache and from there, they cannot access local resources (file system, db,
printer,...).

You can change the security policy for the assembly that you download. This can be done in the Microsoft .NET Framework 1.1 Configuration console or the Microsoft .NET Framework 1.1 Wizards. These can be found in the Administrive tools window. There you can trust the assembly you want to use in the
browser. Not that this has to be done for every client machine that uses
this control.

I don't know if this was the answer you were looking for.
Regards.
Kristof


"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")
Dim fileinfo() As FileInfo = dirinfo.GetFile s
Dim fi As FileInfo
For Each fi In fileinfo
TreeView2.Nodes .Add(fi.Name)
Next
If instead of adding nodes to a treeview, i throw in a response.write the
following works perfectly fine in an aspx page. However, the same code in an embedded windows control causes the component to not load.
everything else in the component will load if i take that out and throw in random values. I suspect this is a security issue but the fact that it works in an aspx page is throwing me off. Currently i am putting the dll into the directory of the page, will it make any difference if i add it to the GAC? I am so close to something really beautiful. any insight would be appreciated.
Thanks

Steve

Nov 18 '05 #4
Thanks for taking the time to response Raterus. I knew about the ie controls
but they won't work for me. I am trying to develop an embedded ftp program
and postbacks are the devil (because i have to reconnect after every
postback). Even though this wasn't what i needed, i appreciate you taking
the time to answer my question.

thanks

steve
"Raterus" <raterus@localh ost> wrote in message
news:Ou******** ******@TK2MSFTN GP11.phx.gbl...
perhaps this will help you fill that treeview of yours, it worked great for me. There should be a vb sample you can download.

http://www.csharpfriends.com/Article...?articleID=109

"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")
Dim fileinfo() As FileInfo = dirinfo.GetFile s
Dim fi As FileInfo
For Each fi In fileinfo
TreeView2.Nodes .Add(fi.Name)
Next
If instead of adding nodes to a treeview, i throw in a response.write the
following works perfectly fine in an aspx page. However, the same code in an embedded windows control causes the component to not load.
everything else in the component will load if i take that out and throw in random values. I suspect this is a security issue but the fact that it works in an aspx page is throwing me off. Currently i am putting the dll into the directory of the page, will it make any difference if i add it to the GAC? I am so close to something really beautiful. any insight would be appreciated.
Thanks

Steve

Nov 18 '05 #5
Never mind i see i have the same options for 1.0

thanks again kristof
"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Kristof,

Thanks, this is exactly the answer i was looking for. What if, let's say, a user didn't go to 2003 (because whidbey was all ready on the horizon and is promising to not rewrite my code) and is still using the original. Is there work arounds that do the same thing for 1.0?

thanks a ton for your time

Steve

"Kristof Van Praet" <kr************ **@hotmail.com> wrote in message
news:eB******** ******@TK2MSFTN GP09.phx.gbl...
You cannot acces the local filesystem from an embedded windows user control.
That is a security issue. Downloaded assemblies are placed in the download cache and from there, they cannot access local resources (file system, db, printer,...).

You can change the security policy for the assembly that you download.

This
can be done in the Microsoft .NET Framework 1.1 Configuration console or

the
Microsoft .NET Framework 1.1 Wizards. These can be found in the

Administrive
tools window. There you can trust the assembly you want to use in the
browser. Not that this has to be done for every client machine that uses
this control.

I don't know if this was the answer you were looking for.
Regards.
Kristof


"A Lonely Programmer" <Sp************ @NoSpamForMe.co m> wrote in message
news:uu******** ******@TK2MSFTN GP09.phx.gbl...
Hi group,

Consider the following code:

Dim dirinfo As New DirectoryInfo(" c:\test")
Dim fileinfo() As FileInfo = dirinfo.GetFile s
Dim fi As FileInfo
For Each fi In fileinfo
TreeView2.Nodes .Add(fi.Name)
Next
If instead of adding nodes to a treeview, i throw in a response.write the following works perfectly fine in an aspx page. However, the same code

in an
embedded windows control causes the component to not load.
everything else in the component will load if i take that out and throw in
random values. I suspect this is a security issue but the fact that it

works
in an aspx page is throwing me off. Currently i am putting the dll into

the
directory of the page, will it make any difference if i add it to the

GAC? I
am so close to something really beautiful. any insight would be

appreciated.

Thanks

Steve


Nov 18 '05 #6

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

Similar topics

1
2385
by: Yongseung Kim | last post by:
Hi, I would like to describe as clear as I can(sorry my english is quite limited) 1. I made a project with vb.net on english XP Pro (The project has a winform with several general controls such as Textbox, label, groupbox) 2. I copied the project to a PC installed with korean XP Pro.
4
314
by: Chris | last post by:
I have a question on whether or not this is good practice. I have a fairly complex web user control (a datalist embedded in a datalist with lots of controls) that I will call Usercontrol1 and a lot of code in the codebehind of the user control for setting/getting properties of the controls. What I would like to do is create a class like this: public class MyClass { UserControl1 _userControl
5
3313
by: Shaul Dar | last post by:
Hi, I am looking for help with the following challenge. We are writing a Smart Client management application, which we want to appear to customers as a Web client. Hence we want to embed it inside IE, but are not sure technically how this may be done. Any ideas, pointers etc will be appreciated. BTW, on MSDN I only found general statements that this is possible, e.g.
3
3590
by: Mathew | last post by:
Hi How do you specfiy the version of the .net runtime libraries loaded for a ..net controls hosted in Internet Explorer 6? I have a control that's designed to work with .NET 1.1, but after installing the VS.NET 2005 beta the web browser embedded control is now running in the .NET 2.0 beta runtime environment, and crashing. Is it possible to have different IE hosted controls running side by side in different versions of the .NET...
55
4659
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's not obvious how the code works if you don't know the intricacies of the Property Let/Get syntax. Likewise, I dislike (and code to minimize the use of) the VB/VBA syntax of returning a value by referring to the function name as if it were a...
8
2833
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 issue...also our clients would like to use a lot of client side events like sorting, searching text, save each row on tab out of a row, use the auto correct feature... after intial r&d we feel that using a Grid Control in WinForms would be a...
3
1881
by: Markus Kling | last post by:
Hi, I have a rich Forms UserControl which is embedded into a web page. Since installing .NET 2.0 on the clients, the control stopped loading completly. - I disabled security completly using caspol -s off => no effect - I enabled fussion logging => no single entry generated - I enabled the IEHost log => nothing created - Changed to another client machine => same issues, same results - I started writing a new UserControl from scratch...
5
10573
by: lamxing | last post by:
Hi, I've come across a strange problem with the WinForm's sizing. I've designed a WinForm and it runs fine on my computer and some other PCs. But when I was trying to run the app under some PCs with wide screen, some of my controls on the WinForm will automatic resize themselves to be bigger and thus push other controls off the screen. For a sample of this problem, please see http://usctimes.com/screen.jpg .. The screen on the left is...
2
3726
by: jyanmin.fang | last post by:
Hi, In my current project, I need to embed an .NET winform usercontrol in the aspx page (via <Objecttag). This winform usercontrol has an event called DoEvent (void DoEvent()). This winform usercontrol will fire this event upon certain action by the user. I tried to let the aspx page subscribe to this event via <script for="winObj1" event="DoEvent()" language="javascript"> window.alert("window control event happen!");
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9026
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
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 we have to send another system
3
2001
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.